آدرس درخواست :
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 }
پارامتر ها :
searchsortشما می توانید نتایج را بصورت دلخواه مرتب کنید.
desc یا عدم ارسال برای جدیدترین ها
asc برای قدیمی ترین ها
آدرس درخواست :
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 }
پارامتر ها :
nameindex_pagenot_found_pageآدرس درخواست :
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 }
آدرس درخواست :
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_pagenot_found_pageآدرس درخواست :
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 }