Skip to content

Uploads advertising campaign costs.

Method upload.campaign_costs
Description Uploads advertising campaign costs.
Who has access Agents and clients
Required component Data API
Maximum cost records per request 500

Request parameters

Name Type Required Valid values Description
access_token string yes Session key used to authenticate the request
user_id number no Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call get.customer_users.
costs array yes Cost records to upload. Maximum: 500
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Start of the cost period. The time component is currently ignored.
date_till iso8601 yes YYYY-MM-DD hh:mm:ss End of the cost period. Must be greater than or equal to date_from. The time component is currently ignored.
campaign_id number yes Unique advertising campaign ID
site_id number yes Unique site ID
cost number yes Advertising campaign cost for the period from date_from through date_till. Set to 0 to delete the cost for that period.

Example request

{
    "jsonrpc": "2.0",
    "id": "number",
    "method": "upload.campaign_costs",
    "params": {
        "access_token": "string",
        "user_id": "number",
        "costs": [
            {
                "campaign_id": "number",
                "cost": "number",
                "date_from": "iso8601",
                "date_till": "iso8601",
                "site_id": "number"
            }
        ]
    }
}

Example response

{
    "jsonrpc": "2.0",
    "id": "number",
    "result": {
        "success": true
    }
}

List of returned errors

See the "List of errors for upload methods" section.