keitaro-api-skill/references/paths/campaigns_id_update_costs.yaml

76 lines
1.7 KiB
YAML

post:
tags:
- Campaigns
security:
- ApiKeyAuth: []
parameters:
- name: id
in: path
description: Campaign ID
required: true
schema:
type: integer
summary: Update costs for campaign
description: >-
<p>Updates campaign costs.</p> <b>IMPORTANT!</b> That actions is VERY SLOW.
Use <a href="#tag/Clicks/paths/~1clicks~1update_costs/post">Update costs in
bulk</a> instead</p>
requestBody:
description: Options
required: true
content:
application/json:
schema:
$ref: ../schemas/CampaignCostRequest.yaml
responses:
'200':
description: Job successfully scheduled
'400':
$ref: ../responses/BadRequest.yaml
'401':
$ref: ../responses/Unauthorized.yaml
'402':
$ref: ../responses/PaymentRequired.yaml
'404':
$ref: ../responses/NotFound.yaml
'406':
$ref: ../responses/NotAcceptable.yaml
'500':
$ref: ../responses/InternalError.yaml
x-code-samples:
- lang: PHP
source: >-
$params = [
'start_date' => '2017-09-10 00:00:00',
'end_date' => '2017-09-12 00:00:00',
'cost' => 10.02,
'currency' => 'EUR',
'timezone' => 'Europe/Moscow',
'only_campaign_uniques' => 1,
'filters': ['sub_id_1' => '1,2,3', 'source': 'site.ru']
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'http://example.com/admin_api/v1/campaigns/2/update_costs');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);