88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
get:
|
|
tags:
|
|
- Affiliate networks
|
|
security:
|
|
- ApiKeyAuth: []
|
|
summary: List all affiliate networks
|
|
description: Returns a list all affiliate networks.
|
|
responses:
|
|
'200':
|
|
description: Affiliate networks
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: ../schemas/AffiliateNetwork.yaml
|
|
'400':
|
|
$ref: ../responses/BadRequest.yaml
|
|
'401':
|
|
$ref: ../responses/Unauthorized.yaml
|
|
'402':
|
|
$ref: ../responses/PaymentRequired.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');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|
|
post:
|
|
tags:
|
|
- Affiliate networks
|
|
security:
|
|
- ApiKeyAuth: []
|
|
requestBody:
|
|
description: Create an affiliate network
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/AffiliateNetworkRequest.yaml
|
|
summary: Create an affiliate network
|
|
description: Create an affiliate network
|
|
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
|
|
'406':
|
|
$ref: ../responses/NotAcceptable.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');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
$params = ["name" => "test", "postback_url" => "http://postback"];
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|