Store/Update AdCosts

This API request stores and updates ad cost data for a specific site using the HTTP method PUT. The request includes the following parameters:

Path Parameters:

SiteIdstringRequired

The ID of the site for which to add or update ad cost data

Headers:

AuthorizationstringRequired

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.

Request Body(JSON payload):

The data containing the ad cost information to store or update. The payload should include the following parameters:

CaptureDateTimestringRequired

The date and time the ad was captured. Must be in ISO 8601 format. yyyy-MM-ddTHH:mm:ss

AdPlatformNamestringRequired

The name of the ad platform Accepts:

[ GoogleAds, YoutubeAds, FacebookAds, InstagramAds, BingAds, LinkedInAds, TikTokAds, PinterestAds ]

Clicksint

The number of clicks generated by the ad.

CostintRequired

The cost of the ad.

CurrencyCodestringRequired

The Currency code for the ad

Impressionsint

The number of times the ad was displayed.

Keywordstring

The keyword used to display the ad.

CampaignIdentifiersArrayRequired

An array of campaign identifiers. Each item in the array should include the following parameters:

IdentifierNamestringRequired

The Name for the campaign identifier.

IdentifierValuestringRequired

The value for the campaign identifier.

ImportanceintRequired

Hierarchical importance (1 = most important)

ReachintRequired

The 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.

Request
PUT
{siteId}/adcosts
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}" }'
Response
Status: 201