لیست دامنه ها

آدرس درخواست :

GET
https://zaya.io/api/v1/domains

مثال درخواست:

# CURL Example:
curl --location --request GET 'https://zaya.io/api/v1/domains' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$params = [];
$url = "https://zaya.io/api/v1/domains";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer {api_key}'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result = json_decode($result, true);

پاسخ ها :

200

{
    "data": [
        {...}
    ],
    "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
    },
    "meta": {
        "current_page": 0,
        "from": 0,
        "last_page": 0,
        "links": [
            {pagination}
        ],
        "path": "string",
        "per_page": 0,
        "to": 0,
        "total": 0
    }
}
403412

{
    "message": "string",
    "status": INTEGER
}

پارامتر ها :

نام
نوع
توضیحات
team_id
اختیاری integer
شناسه اختیاری تیم از GET /api/v1/teams؛ دسترسی و محدودیت پلن بررسی می‌شود. بدون آن رفتار قبلی حفظ می‌شود.
scope
اختیاری string
مقدار اختیاری personal برای انتخاب صریح منابع شخصی؛ هم‌زمان با team_id ارسال نشود.
search
اختیاری string
با استفاده از این پارامتر می توانید دامنه مورد نظر خود را پیدا کنید.
sort
اختیاری string

شما می توانید نتایج را بصورت دلخواه مرتب کنید.

desc یا عدم ارسال برای جدیدترین ها

asc برای قدیمی ترین ها

ساخت دامنه

آدرس درخواست :

POST
https://zaya.io/api/v1/domains

مثال ها :

# CURL Example:
curl --location --request POST 'https://zaya.io/api/v1/domains' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name={domain_name}'
# PHP Example:
$url = "https://zaya.io/api/v1/domains";
$params = ['name' => '{domain_name}'];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer {api_key}'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result = json_decode($result, true);

پاسخ ها :

200

{
    "data": [
        {...}
    ],
    "status": 200
}
403412

{
    "message": "string",
    "status": INTEGER
}
422

{
    "message": {
        "param": [
            "string"
        ]
    },
    "status": INTEGER
}

پارامتر ها :

نام
نوع
توضیحات
name
ضروری string
نام دامنه.
index_page
اختیاری string
آدرسی که صفحه ایندکس به آن ریدایرکت می شود.
not_found_page
اختیاری string
آدرسی که صفحه ی ۴۰۴ به آن ریدایرکت می شود.

جزییات دامنه

آدرس درخواست :

GET
https://zaya.io/api/v1/domains/{id}

مثال ها :

# CURL Example:
curl --location --request GET 'https://zaya.io/api/v1/domains/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$url = "https://zaya.io/api/v1/domains/{id}";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer {api_key}'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result = json_decode($result, true);

پاسخ ها :

200

{
    "data": [
        {...}
    ],
    "status": 200
}
403412404

{
    "message": "string",
    "status": INTEGER
}

بروزرسانی دامنه

آدرس درخواست :

PUT PATCH
https://zaya.io/api/v1/domains/{id}

مثال ها :

# CURL Example:
curl --location --request PUT 'https://zaya.io/api/v1/domains/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name={domain.com}'
# PHP Example:
$params = ['name' => '{domain_name}'];
$url = https://zaya.io/api/v1/domains/{id};

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer {api_key}'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result = json_decode($result, true);

پاسخ ها :

200

{
    "data": [
        {...}
    ],
    "status": 200
}
403412404

{
    "message": "string",
    "status": INTEGER
}
422

{
    "message": {
        "param": [
            "string"
        ]
    },
    "status": INTEGER
}

پارامتر ها :

نام
نوع
توضیحات
index_page
اختیاری string
آدرسی که صفحه ایندکس به آن ریدایرکت می شود.
not_found_page
اختیاری string
آدرسی که صفحه ی ۴۰۴ به آن ریدایرکت می شود.

حذف دامنه

آدرس درخواست :

DELETE
https://zaya.io/api/v1/domains/{id}

مثال درخواست:

# CURL Example:
curl --location --request DELETE 'https://zaya.io/api/v1/domains/{id}' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$url = https://zaya.io/api/v1/domains/{id};

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer {api_key}'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result = json_decode($result, true);

پاسخ ها :

200

{
    "id": int,
    "object": "domain",
    "deleted": boolean,
    "status": 200
}
403412404

{
    "message": "string",
    "status": INTEGER
}
نظرسنجی

آیا از امکانات زایا راضی هستید؟

خیلی ناراضی
ناراضی
معمولی
راضی
خیلی راضی

زایا همیشه در حال ارتقا سیستم و اضافه کردن امکانات کاربردی می باشد. نظرات شما باعت پیشرفت سیستم خواهد شد.