156 lines
3.5 KiB
YAML
156 lines
3.5 KiB
YAML
get:
|
|
tags:
|
|
- Domains
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Domain ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
summary: Get domain
|
|
description: Return domain details.
|
|
responses:
|
|
'200':
|
|
description: Domain details.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/Domain.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/domains/1');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
echo curl_exec($ch);
|
|
put:
|
|
tags:
|
|
- Domains
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Domain ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
summary: Update domain
|
|
description: Updates domain.
|
|
requestBody:
|
|
description: Domain fields to update
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/DomainRequest.yaml
|
|
responses:
|
|
'200':
|
|
description: Domain
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/Domain.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/domains');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
$params = [
|
|
|
|
'name' => 'domain1.com',
|
|
|
|
];
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
|
|
|
|
echo curl_exec($ch);
|
|
delete:
|
|
tags:
|
|
- Domains
|
|
security:
|
|
- ApiKeyAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Domain ID
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
summary: Move Domain to Archive
|
|
description: Move a Domain to Archive
|
|
responses:
|
|
'201':
|
|
description: Move a Domain to Archive
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../schemas/Domain.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/domains/1');
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Api-Key: your-api-key'));
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
|
|
|
echo curl_exec($ch);
|