مرجع API · Talk to an expert
Edit expert request
patch
/consultations/{id}| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
Same body as create. Only while the request is still new.
پارامترها
| نام | محل | نوع | توضیح |
|---|---|---|---|
id* | path | integer | Postman variable {{consultationId}} |
بدنه درخواست
نمونهjson
{
"name": "نسرین کاظمی",
"phone": "09123456789",
"method": "meet",
"time_slot": "evening",
"note": "ترجیح میدهم جلسه آنلاین باشد.",
"source_page": "r2"
}
پاسخها
200 — ConsultationRequest
| فیلد | نوع | توضیح |
|---|---|---|
id* | integer | Unique ID. |
name* | string | |
phone* | string | Mobile number. |
method* | string | |
time_slot* | string | |
preferred_days* | any[] | |
note* | string | null | |
source_page* | string | null | |
status* | string | Current status. |
due_at* | string | null | |
snapshot* | object | |
snapshot.brand* | string | null | |
snapshot.plan* | string | string ("free") | Plan: free (Free) or paid (Pro). |
snapshot.share* | string | null | |
snapshot.gaps* | string | null | Missed questions: AI named a competitor and not you. |
snapshot.last_run_at* | string | null | |
snapshot.source_page* | string | null | |
created_at* | string | null | When it was created (ISO 8601). |
json
{
"id": 0,
"name": "",
"phone": "",
"method": "",
"time_slot": "",
"preferred_days": [
null
],
"note": "",
"source_page": "",
"status": "",
"due_at": "",
"snapshot": {
"brand": "",
"plan": "",
"share": "",
"gaps": "",
"last_run_at": "",
"source_page": ""
},
"created_at": ""
}
401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)
| فیلد | نوع |
|---|---|
message* | string |
code | string |
json
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
403 — Already picked up by a consultant: {"code":"forbidden"}
| فیلد | نوع |
|---|---|
message* | string |
code* | string ("plan_limit", "forbidden") |
json
{
"message": "این امکان در طرح راوی حرفهای است.",
"code": "plan_limit"
}
404 — Unknown id (or not owned by the caller)
| فیلد | نوع |
|---|---|
message* | string |
json
{
"message": ""
}
422 — Validation failed (as POST)
| فیلد | نوع |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
نمونهٔ curl
bash
curl -X PATCH 'http://127.0.0.1:8010/api/consultations/{id}' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "نسرین کاظمی",
"phone": "09123456789",
"method": "meet",
"time_slot": "evening",
"note": "ترجیح میدهم جلسه آنلاین باشد.",
"source_page": "r2"
}'