آدرس درخواست :
https://zaya.io/api/v1/spaces
مثال درخواست:
# CURL Example:
curl --location --request GET 'https://zaya.io/api/v1/spaces' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$params = [];
$url = "https://zaya.io/api/v1/spaces";
$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 }
پارامتر ها :
search
sort
شما می توانید نتایج را بصورت دلخواه مرتب کنید.
desc
یا عدم ارسال برای جدیدترین ها
asc
برای قدیمی ترین ها
آدرس درخواست :
https://zaya.io/api/v1/spaces
مثال ها :
# CURL Example:
curl --location --request POST 'https://zaya.io/api/v1/spaces' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name={space_name}' \
--data-urlencode 'color={color}'
# PHP Example:
$url = "https://zaya.io/api/v1/spaces";
$params = [
'name' => '{space_name}',
'color' => '{color}'
];
$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
color
کد رنگ موضوع
نکته:
کد رنگ مورد نظر باید براساس HEX (#ff0000) باشد.
آدرس درخواست :
https://zaya.io/api/v1/spaces/{id}
مثال ها :
# CURL Example:
curl --location --request GET 'https://zaya.io/api/v1/spaces/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$url = "https://zaya.io/api/v1/spaces/{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/spaces/{id}
مثال ها :
# CURL Example:
curl --location --request PUT 'https://zaya.io/api/v1/spaces/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name={space_name}'
# PHP Example:
$params = ['name' => '{space_name}'];
$url = https://zaya.io/api/v1/spaces/{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 }
پارامتر ها :
name
color
کد رنگ موضوع
نکته:
کد رنگ مورد نظر باید براساس HEX (#ff0000) باشد.
آدرس درخواست :
https://zaya.io/api/v1/spaces/{id}
مثال درخواست:
# CURL Example:
curl --location --request DELETE 'https://zaya.io/api/v1/spaces/{id}' \
--header 'Authorization: Bearer {api_key}'
# PHP Example:
$url = https://zaya.io/api/v1/spaces/{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 }