This API request stores and updates ad cost data for a specific site using the HTTP method PUT. The request includes the following parameters:
SiteId
stringRequiredThe ID of the site for which to add or update ad cost data
Authorization
stringRequired The authorization token for accessing the API. The header value should be set to "Bearer {your-access-token}", where {your-access-token}
is the access token assigned to the user.
The data containing the ad cost information to store or update. The payload should include the following parameters:
CaptureDateTime
stringRequiredThe date and time the ad was captured. Must be in ISO 8601 format. yyyy-MM-ddTHH:mm:ss
AdPlatformName
stringRequiredThe name of the ad platform Accepts:
[ GoogleAds, YoutubeAds, FacebookAds, InstagramAds, BingAds, LinkedInAds, TikTokAds, PinterestAds ]
Clicks
intThe number of clicks generated by the ad.
Cost
intRequiredThe cost of the ad.
CurrencyCode
stringRequiredThe Currency code for the ad
Impressions
intThe number of times the ad was displayed.
Keyword
stringThe keyword used to display the ad.
CampaignIdentifiers
ArrayRequiredAn array of campaign identifiers. Each item in the array should include the following parameters:
IdentifierName
stringRequiredThe Name for the campaign identifier.
IdentifierValue
stringRequiredThe value for the campaign identifier.
Importance
intRequiredHierarchical importance (1 = most important)
Reach
intRequiredThe estimated number of people who saw the ad.
The {siteId}
parameter in the URL endpoint should be replaced with the appropriate ID for the site being updated, and the {your-access-token}
parameter in the authorization header should be replaced with the appropriate access token.
curl -X PUT \ 'https://rest.rulerapi.com/v1/{siteId}/adcosts' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "CaptureDateTime": "{captureDateTime}", "AdPlatformName": "{adPlatformName}", "Clicks": "{clicks}", "Cost": "{cost}", "CurrencyCode": "{currencyCode}", "Impressions": "{impressions}", "Keyword": "{keyword}", "CampaignIdentifiers": [ { "IdentifierName": "{identifierName}", "IdentifierValue": "{IdentifierValue}", "Importance": "{importance}" } ], "Reach": "{reach}" }'