This API request stores and updates Facebook 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:
account_currency
stringRequiredThe currency used for the ad account.
campaign_id
stringRequiredThe ID of the campaign for the ad.
campaign_name
stringRequiredThe name of the campaign for the ad.
adset_id
stringRequiredThe ID of the ad set for the ad.
adset_name
stringRequiredThe name of the ad set for the ad.
ad_id
stringRequiredThe ID of the ad.
ad_name
stringRequiredThe name of the ad.
clicks
stringRequiredThe number of clicks generated by the ad.
ctr
stringThe click-through rate of the ad.
spend
stringRequiredThe amount spent on the ad.
cpc
stringThe cost per click of the ad.
impressions
stringRequiredThe number of times the ad was shown.
conversions
arrayThe conversions generated by the ad.
cost_per_conversion
floatThe cost per conversion of the ad.
reach
intRequiredThe number of unique people who saw the ad.
date_start
stringRequiredThe start date of the ad campaign, must be in ISO 8601 format. yyyy-dd-mm
date_stop
stringRequiredThe end date of the ad campaign, must be in ISO 8601 format. yyyy-dd-mm
publisher_platform
stringRequiredThe platform where the ad was published.
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/facebook' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "account_currency": "{account_currency}", "campaign_id": "{campaign_id}", "campaign_name": "{campaign_name}", "adset_id": "{adset_id}", "adset_name": "{adset_name}", "ad_id": "{ad_id}", "ad_name": "{ad_name}", "clicks": "{clicks}", "ctr": "{ctr}", "spend": "{spend}", "cpc": "{cpc}", "impressions": "{impressions}", "conversions": "{ onversions}", "cost_per_conversion": "{cost_per_conversion}", "reach": "{reach}", "date_start": "{date_start}", "date_stop": "{date_stop}", "publisher_platform": "{publisher_platform}" }'