Rawi

مرجع API · Questions

Edit question text

patch/questions/{id}
احراز هویتتوکن مشتری (Bearer)
سطح دسترسیکاربر رایگان · کاربر حرفه‌ای

Customer token (Bearer) — free and paid users

Inline edit. The text is re-checked: 10–300 chars and unbranded/competitor questions may not contain the user's own brand name.

پارامترها

ناممحلنوعتوضیح
id*pathintegerPostman variable {{questionId}}

بدنه درخواست

فیلدنوعتوضیح
text*string10–300 chars; no own-brand name in unbranded/competitor questions
نمونهjson
{
  "text": "نشانه‌های اینکه یک شرکت کوچک به نرم‌افزار حسابداری ابری نیاز دارد چیست؟"
}

پاسخ‌ها

200 — Question

فیلدنوعتوضیح
id*integerUnique ID.
stage*stringBuying stage of the question.
type*string
text*string
language*string
cell_id*integer | nullthe question's own language: lang/dir on its text (as in the reports)
position*integer
edited*boolean
json
{
  "id": 345,
  "stage": "problem",
  "type": "unbranded",
  "text": "نشانه‌های اینکه یک شرکت کوچک به نرم‌افزار حسابداری ابری نیاز دارد چیست؟",
  "language": "fa",
  "cell_id": 9,
  "position": 1,
  "edited": true
}

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 — plan_limit — no changes left this month («تغییر مجاز این ماه»)

فیلدنوع
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 (text length / brand name)

فیلدنوع
message*string
errors*object
json
{
  "message": "",
  "errors": {
    "email": [
      "ایمیل معتبر نیست."
    ]
  }
}

نمونهٔ curl

bash
curl -X PATCH 'http://127.0.0.1:8010/api/questions/{id}' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "نشانه‌های اینکه یک شرکت کوچک به نرم‌افزار حسابداری ابری نیاز دارد چیست؟"
}'

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