| Method | upload.campaign_costs |
|---|---|
| Description | Loading expenses for advertising campaigns |
| Available to | Agent, Client |
| Necessary components for working with the method | Data API |
| Maximum number of costs in one request | 500 pcs |
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Authentication session key | |
user_id |
number | no | Unique user identifier of the agent client on behalf of which the request is made
Required for the agentTo obtain a list of client users, you must use the "get.customer_users" method |
|
costs |
array | yes | List of expenses for advertising campaigns. Maximum 500 | |
date_from |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | The start date and time of the downloadable expense period. Currently the time is ignored. |
date_till |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | Date and time of the end of the downloadable expense period. Cannot be less than date_from. Currently the time is ignored. |
campaign_id |
number | yes | Unique identifier of the advertising campaign. | |
site_id |
number | yes | Unique site identifier. | |
cost |
number | yes | Advertising campaign expenses for the specified period date_from and date_till. If 0 is specified, expenses for the specified period will be deleted. |
JSON request structure```json
{ "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" } ] } }
### JSON response structure```json
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"success": "true"
}
}
List of returned errors
Look at the section "List of errors for methods with the verb upload"