If you are planning to use Donations API you will need the WidgetID to send emails like (acknowledgment, receipt), CampaignID (to assign the donation to a campaign), and CategoryID (to assign a general ledger code) to the donation.
You can get those values from the Vega API page itself from the left-hand side menu:
If you can't see any widget in the widgets section you can either create a new one here (it will use default emails) or you can get the widget ID from Admin > Widget Configuration where you can configure the email documents and other settings.
The Campaigns section will show you the campaign name and campaignID, so you can get the campaignID from it
Similarly, you can get the GL code and its ID from the GL Codes section.
Sending API call
Open the Vega API page: api.vega.works
There you will see a list of different APIs you can use.
Here we will talk about the most common API: donations. If you click on Donations you will see:
1. Click on Post Donations, it will give you the instructions and the model for Posting the donation:
2. If you click on the example Value on the right side, it will fill up the value on the right side in the parameter Value
3. You can use the API page itself to test the API. You can directly enter the values in the model and click on the Try it out button.
4. If you click the Try it out button, it will ask you for a username and password which you got from the Vega API page. Fill it and click Sign In and It will send out the API request and will return the appropriate response.
The other way, you can use Postman.
1. In Authenticationm use basic Auth and add username and password
2. Copy the donation data model pate in postman body (raw, JSON)
Distributions and Attributes
You can add multiple distributions and Attributes by just adding another array in the attributes and distributions object. For e.g.
"Attributes": [
{
"AttributeID": 0,
"AttributeDescription": "string",
"AttributeTypeID": 0,
"AttributeValue": "string"
},
{
"AttributeID": 0,
"AttributeDescription": "string",
"AttributeTypeID": 0,
"AttributeValue": "string"
}
]
Adding Distribution
Distribution model is:
Distribution": [
{
"DonationDistributionID": 0,
"LogID": 0,
"CategoryID": 0,
"CampaignID": 0,
"Amount": 0,
"AttrubuteID": 0,
"Quantity": 0,
"TableNo": 0,
"DocumentID": 0,
"SendByID": 0
}
]
If you are not adding distribution then you can leave the Distribution object as it is. Vega will automatically distribute the donation. If you are adding distributions (if you have more than 1 distribution) then CampaignID and CategoryID are required. Rest are optional values and you can leave them 0( it will save as null in the table)
If you are more than 1 distribution then you can just duplicate the distribution array in a distribution object like:
Distribution": [
{
"DonationDistributionID": 0,
"LogID": 0,
"CategoryID": 0,
"CampaignID": 0,
"Amount": 0,
"AttrubuteID": 0,
"Quantity": 0,
"TableNo": 0,
"DocumentID": 0,
"SendByID": 0
},
{
"DonationDistributionID": 0,
"LogID": 0,
"CategoryID": 0,
"CampaignID": 0,
"Amount": 0,
"AttrubuteID": 0,
"Quantity": 0,
"TableNo": 0,
"DocumentID": 0,
"SendByID": 0
}
]
Comments
0 comments
Please sign in to leave a comment.