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

96 lines
2.2 KiB
YAML

get:
tags:
- Domains
security:
- ApiKeyAuth: []
summary: Get the list of domains
description: Returns list of the domains
responses:
'200':
description: List of the domains
content:
application/json:
schema:
type: array
items:
$ref: ../schemas/Domain.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/domains');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
post:
tags:
- Domains
security:
- ApiKeyAuth: []
requestBody:
description: Create a domain
required: true
content:
application/json:
schema:
allOf:
- $ref: ../schemas/DomainRequest.yaml
- $ref: ../schemas/DomainCreateRequired.yaml
summary: Create domain
description: Create a domain
responses:
'200':
description: Domain data
content:
application/json:
schema:
type: array
items:
$ref: ../schemas/Domain.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/domains');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
$params = [
'name' => 'domain1.com',
];
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
echo curl_exec($ch);