Create/Update Campaigns
The Create/Update Campaign API is designed for creating or updating advertising campaigns within our platform. This functionality is crucial for launching new campaigns and adjusting existing ones to align with marketing strategies and budget adjustments.
-
Method:
POST
-
URL:
https://<PA_RM_END_POINT>/rm/1.0/campaign
-
Headers:
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN
-
Request Body Parameters:
-
id (GUID)
: The primary identifier for the campaign.infoid
is required if updating an existing campaign. If theid
is not provided, a new campaign will be created. -
name (string)
[REQUIRED]: The name of the campaign. -
businessUnitId (string)
[REQUIRED]: The Business Unit's ID this campaign belongs to. -
startDate (dateTime)
[REQUIRED]: The start date and time of the campaign. -
endDate (dateTime)
: The end date and time of the campaign. If not provided, the campaign is considered ongoing. -
dailyCap (decimal)
: The maximum amount that can be spent per day. -
totalBudget (decimal)
: The total budget allocated for the campaign. -
autoRenewBudget (boolean)
: Indicates whether the campaign budget should auto-renew upon depletion. -
clicks (integer)
: The number of clicks the campaign aims to achieve. This can be set as a target for performance tracking. -
impressions (integer)
: The target number of impressions for the campaign. -
status (integer)
: The current status of the campaign, where certain codes represent specific states such as active, paused, etc.
-
-
Response Codes:
-
200 OK
Successful request. The response body will include the campaign details and a message indicating the success of the operation:
{
"message": "Campaign created/updated successfully.",
"campaign": {
"id": "xxxxxxxxxxxxxxxxxxxxxxx",
"name": "Name of the campaign",
"businessUnitId": "xxxxxxxxxxxxxxxxxxxxxxx",
"startDate": "2024-05-03T00:00:00",
"endDate": "2024-05-16T23:59:59",
"dailyCap": 100.00,
"totalBudget": 5000.00,
"autoRenewBudget": true,
"clicks": 1000,
"impressions": 50000,
"status": 1
}
} -
Non-200 Responses
If an error occurs (e.g., bad request, unauthorized access), the server will respond with an appropriate non-200 status code and include an error message in the response body:
{
"error": "Error message"
}noteIt is important to handle campaign data securely and ensure that access is restricted to authorized users only.
-