Sign in with username and password
Returns a bearer token pair. Failed attempts count toward the same lockout and per-network/device
throttling as the dashboard sign-in (HTTP 401 auth.invalid_credentials, then 429
auth.login_temporarily_blocked). The company must have the public API enabled, otherwise
403 channel_disabled and no token is issued. Rate limit policy: 30 requests per minute per IP.
جسم الطلب · PublicLoginRequestapplication/json
The credentials.
| الحقل | النوع | الوصف |
|---|---|---|
username | stringيقبل null | Username or e-mail address. |
password | stringيقبل null | Password. |
وثيقة OpenAPI لا تعلّم الحقول المطلوبة رسمياً، لذلك تُقرأ كلمة «مطلوب» من وصف كل حقل. تسرد الأدلة الحقول المطلوبة لكل طلب.
مثال طلب
curl -X POST "https://api.goldrock.live/api/public/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"username": "ahmed@your-company.example",
"password": "YOUR_PASSWORD"
}'const response = await fetch("https://api.goldrock.live/api/public/v1/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"username": "ahmed@your-company.example",
"password": "YOUR_PASSWORD"
}),
});
const data = await response.json();
console.log(response.status, data);<?php
$url = 'https://api.goldrock.live/api/public/v1/auth/login';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'username' => 'ahmed@your-company.example',
'password' => 'YOUR_PASSWORD',
], JSON_UNESCAPED_UNICODE),
]);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($status, json_decode($result, true));import requests
response = requests.request(
"POST",
"https://api.goldrock.live/api/public/v1/auth/login",
json={
"username": "ahmed@your-company.example",
"password": "YOUR_PASSWORD",
},
timeout=30,
)
print(response.status_code, response.json())تستخدم الأمثلة مفتاح API؛ استبدل القيم النائبة. لاستخدام رمز Bearer أرسل Authorization: Bearer <accessToken>.
الاستجابات
200Signed in.
الاستجابات · الحقل
| الحقل | النوع | الوصف |
|---|---|---|
accessToken | stringيقبل null | JWT to send as |
refreshToken | stringيقبل null | Single-use refresh token. |
tokenType | stringيقبل null | Always |
expiresIn | integer (int32) | Lifetime of the access token in seconds. |
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "q3kZ0m8w...",
"tokenType": "Bearer",
"expiresIn": 900
}| الحالة | الوصف |
|---|---|
400 | The request is invalid (code |
401 | Wrong username or password. |
403 | Public API disabled for the company, company suspended, or account inactive. |
422 | A business rule or a location could not be satisfied (codes such as |
429 | Too many attempts. |
تشترك أخطاء الواجهة في جسم واحد موصوف في مرجع الأخطاء. مرجع الأخطاء