Save Campaign
Systems can create or update campaign records in the Donary system by using the Save Campaign API.
Endpoint
/V1/External/SaveCampaign
Http Request Method
PUT
Request Header
APIKey - The API key for authorization.
Request Body
* Indicates required field.
* Provide if updating a specific campaign.
* Either campaignName
or campaignFriendlyName
is required.
Name | Type | Description |
---|---|---|
orgGuid * | string | Organization's unique identifier. |
campaignNumber * | int | Campaign number - if provided, the existing campaign record will be updated. Click here for more information about this field. |
campaignName * | string | Campaign name. |
campaignFriendlyName * | string | Campaign friendly name. |
Response
See list of possible errors.
Create Campaign Example:
This example will create a new campaign and return the campaignNumber
, 1006
.
Please note - campaignNumber
is set to zero (there is no existing record with that ID) and will create a new campaign.
cURL:
curl --location --request PUT 'https://webapi.donary.com/V1/External/SaveCampaign' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","campaignNumber":0,"campaignName":"Gold Page","campaignFriendlyName":"Request Donation / Gold Page"}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"campaignNumber": 0,
"campaignName": "Gold Page",
"campaignFriendlyName": "Request Donation / Gold Page"
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"campaignNumber": 1006,
"campaignName": "Gold Page",
"campaignFriendlyName": "Request Donation / Gold Page"
}
Update Campaign Example:
This example will update Campaign 1006's campaignName
and campaignFriendlyName
.
Please note: The campaignNumber
must be included in the payload to update the specified campaign. Learn more about how to update a record here.
cURL:
curl --location --request PUT 'https://webapi.donary.com/V1/External/SaveCampaign' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","campaignNumber":1006,"campaignName":"Silver Page","campaignFriendlyName":"Request Donation / Silver Page"}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"campaignNumber": 1006,
"campaignName": "Silver Page",
"campaignFriendlyName": "Request Donation / Silver Page"
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"campaignNumber": 1006,
"campaignName": "Silver Page",
"campaignFriendlyName": "Request Donation / Silver Page"
}