Rawi

مرجع 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*pathintegerPostman variable {{consultationId}}

بدنه درخواست

نمونهjson
{
  "name": "نسرین کاظمی",
  "phone": "09123456789",
  "method": "meet",
  "time_slot": "evening",
  "note": "ترجیح می‌دهم جلسه آنلاین باشد.",
  "source_page": "r2"
}

پاسخ‌ها

200 — ConsultationRequest

فیلدنوعتوضیح
id*integerUnique ID.
name*string
phone*stringMobile number.
method*string
time_slot*string
preferred_days*any[]
note*string | null
source_page*string | null
status*stringCurrent 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 | nullMissed questions: AI named a competitor and not you.
snapshot.last_run_at*string | null
snapshot.source_page*string | null
created_at*string | nullWhen 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
codestring
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"
}'

امتحان در کنسول