151 lines
3.7 KiB
YAML
151 lines
3.7 KiB
YAML
get:
|
|
tags:
|
|
- Affiliate networks
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Affiliate network ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
summary: Retrieve Affiliate network details
|
|
description: Retrieve affiliate metwork details
|
|
responses:
|
|
'200':
|
|
description: Affiliate network
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/AffiliateNetwork.yaml
|
|
'400':
|
|
$ref: ../responses/BadRequest.yaml
|
|
'401':
|
|
$ref: ../responses/Unauthorized.yaml
|
|
'402':
|
|
$ref: ../responses/PaymentRequired.yaml
|
|
'404':
|
|
$ref: ../responses/NotFound.yaml
|
|
'500':
|
|
$ref: ../responses/InternalError.yaml
|
|
x-code-samples:
|
|
- lang: PHP
|
|
source: >-
|
|
$ch = curl_init();
|
|
|
|
curl_setopt($ch, CURLOPT_URL,
|
|
'http://example.com/admin_api/v1/affiliate_networks/1');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|
|
put:
|
|
tags:
|
|
- Affiliate networks
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Affiliate network ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: Affiliate network fields to update
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/AffiliateNetworkPut.yaml
|
|
summary: Update Affiliate network
|
|
description: Update an Affiliate network
|
|
responses:
|
|
'200':
|
|
description: Affiliate network
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/AffiliateNetwork.yaml
|
|
'400':
|
|
$ref: ../responses/BadRequest.yaml
|
|
'401':
|
|
$ref: ../responses/Unauthorized.yaml
|
|
'402':
|
|
$ref: ../responses/PaymentRequired.yaml
|
|
'404':
|
|
$ref: ../responses/NotFound.yaml
|
|
'500':
|
|
$ref: ../responses/InternalError.yaml
|
|
x-code-samples:
|
|
- lang: PHP
|
|
source: >-
|
|
$params = ["name": "test2", "postback_url": "http://postback2"];
|
|
|
|
|
|
$ch = curl_init();
|
|
|
|
curl_setopt($ch, CURLOPT_URL,
|
|
'http://example.com/admin_api/v1/affiliate_networks/4');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|
|
delete:
|
|
tags:
|
|
- Affiliate networks
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Affiliate network ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
summary: Move affiliate network to the archive
|
|
description: Move affiliate network to the archive
|
|
responses:
|
|
'200':
|
|
description: Affiliate network details
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/AffiliateNetwork.yaml
|
|
'400':
|
|
$ref: ../responses/BadRequest.yaml
|
|
'401':
|
|
$ref: ../responses/Unauthorized.yaml
|
|
'402':
|
|
$ref: ../responses/PaymentRequired.yaml
|
|
'404':
|
|
$ref: ../responses/NotFound.yaml
|
|
'500':
|
|
$ref: ../responses/InternalError.yaml
|
|
x-code-samples:
|
|
- lang: PHP
|
|
source: >-
|
|
$ch = curl_init();
|
|
|
|
curl_setopt($ch, CURLOPT_URL,
|
|
'http://example.com/admin_api/v1/affiliate_networks/1');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|