Rawi

مرجع API · Onboarding

Generate question set

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

Customer token (Bearer) — free and paid users

(Re)builds the question set from templates: per-stage counts from the plan (free 1/2/2/4/1, paid 3/4/4/10/4) split across active cells. Old questions are deactivated, never deleted. The new set waits for approval.

پاسخ‌ها

200 — QuestionsResponse

فیلدنوعتوضیح
questions*object[]
questions[].id*integerUnique ID.
questions[].stage*stringBuying stage of the question.
questions[].type*string
questions[].text*string
questions[].language*string
questions[].cell_id*integer | nullthe question's own language: lang/dir on its text (as in the reports)
questions[].position*integer
questions[].edited*boolean
stage_counts*objectNumber of questions per buying stage.
stage_counts.probleminteger
stage_counts.solutioninteger
stage_counts.criteriainteger
stage_counts.selectioninteger
stage_counts.validationinteger
changes*object
changes.used*integer
changes.limit*integer
changes.remaining*any
changes.month*any
changes.resets_at*string
changes.counting*boolean
language*string
engine_label*string
json
{
  "questions": [
    {
      "id": 345,
      "stage": "problem",
      "type": "unbranded",
      "text": "نشانه‌های اینکه یک شرکت کوچک به نرم‌افزار حسابداری ابری نیاز دارد چیست؟",
      "language": "fa",
      "cell_id": 9,
      "position": 1,
      "edited": true
    },
    {
      "id": 346,
      "stage": "solution",
      "type": "unbranded",
      "text": "انواع نرم‌افزار حسابداری ابری چیست و هر کدام برای چه شرکتی مناسب است؟",
      "language": "fa",
      "cell_id": 9,
      "position": 2,
      "edited": false
    }
  ],
  "stage_counts": {
    "problem": 1,
    "solution": 2,
    "criteria": 2,
    "selection": 4,
    "validation": 1
  },
  "changes": {
    "used": 0,
    "limit": 2,
    "remaining": 2,
    "month": "1405-09",
    "resets_at": "2026-12-21T20:30:00Z",
    "counting": false
  },
  "language": "fa",
  "engine_label": "ChatGPT"
}

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"
}

422 — Validation failed (questions — no product/customer yet)

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

نمونهٔ curl

bash
curl -X POST 'http://127.0.0.1:8010/api/onboarding/questions' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN"

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