API reference · Questions
Edit question text
patch
/questions/{id}| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user 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.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id* | path | integer | Postman variable {{questionId}} |
Request body
| Field | Type | Description |
|---|---|---|
text* | string | 10–300 chars; no own-brand name in unbranded/competitor questions |
Examplejson
{
"text": "نشانههای اینکه یک شرکت کوچک به نرمافزار حسابداری ابری نیاز دارد چیست؟"
}
Responses
200 — Question
| Field | Type | Description |
|---|---|---|
id* | integer | Unique ID. |
stage* | string | Buying stage of the question. |
type* | string | |
text* | string | |
language* | string | |
cell_id* | integer | null | the 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)
| Field | Type |
|---|---|
message* | string |
code | string |
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 («تغییر مجاز این ماه»)
| Field | Type |
|---|---|
message* | string |
code* | string ("plan_limit", "forbidden") |
json
{
"message": "این امکان در طرح راوی حرفهای است.",
"code": "plan_limit"
}
404 — Unknown id (or not owned by the caller)
| Field | Type |
|---|---|
message* | string |
json
{
"message": ""
}
422 — Validation failed (text length / brand name)
| Field | Type |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
curl example
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": "نشانههای اینکه یک شرکت کوچک به نرمافزار حسابداری ابری نیاز دارد چیست؟"
}'