Generate Suggested Questions
Last updated:2024-03-01
Generate Suggested Questions
Based on the bot's response in the conversation, provide the user with several questions that can be used to continue the chat.
Request Method
GET
Request URL
https://api.gptbots.ai/v1/next/question
Request Authentication
See Overview for authentication details.
Request
Request Example
curl --location 'https://api.gptbots.ai/v1/next/question?answer_id=65deb0cb2bab4d7c8061d87d' \
--header 'Authorization: Bearer your_apikey'
curl --location 'https://api.gptbots.ai/v1/next/question?answer_id=65deb0cb2bab4d7c8061d87d' \
--header 'Authorization: Bearer your_apikey'
This code block in the floating window
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${token} | Use Authorization: Bearer ${token} for authentication. Get the key from the API Keys page as token. |
Content-Type | application/json | Data type, set to application/json. |
Request Body
Field | Type | Required | Description |
---|---|---|---|
answer_id | string | true | Message ID of the Bot's response. |
Response
Response Example
{
"questions": [
"What kind of support do you need about the product?",
"Do you have any questions about our service?",
"Do you have any advices about our product?"
]
}
{
"questions": [
"What kind of support do you need about the product?",
"Do you have any questions about our service?",
"Do you have any advices about our product?"
]
}
This code block in the floating window
Suceess Response
Field | Type | Description |
---|---|---|
questions | Array | Generated questions. |
Failure Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Error details. |
Error Codes
Code | Message |
---|---|
40000 | Invalid parameter |
40379 | Credit not enough |
200222 | Bot configuration does not support this feature. |
40378 | Bot deleted |
20055 | API is forbidden |
40127 | Developer authentication failed |