مرجع API · Questions
Replace question («پرسش دیگر»)
post
/questions/{id}/replace| احراز هویت | توکن مشتری (Bearer) |
|---|---|
| سطح دسترسی | کاربر رایگان · کاربر حرفهای Customer token (Bearer) — free and paid users |
Swaps the question for the next unused template of the same stage/type/cell.
پارامترها
| نام | محل | نوع | توضیح |
|---|---|---|---|
id* | path | integer | Postman variable {{questionId}} |
پاسخها
200 — Question
| فیلد | نوع | توضیح |
|---|---|---|
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": 0,
"stage": "",
"type": "",
"text": "",
"language": "",
"cell_id": 0,
"position": 0,
"edited": false
}
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 — plan_limit — no changes left
| فیلد | نوع |
|---|---|
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 (question — no alternative template left)
| فیلد | نوع |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
نمونهٔ curl
bash
curl -X POST 'http://127.0.0.1:8010/api/questions/{id}/replace' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN"