Subscription check
Methods for @BotMembersRobot: checks go through your bot connected to the service. code - the bot code issued by @BotMembersRobot.
GET
/checksub/{code}/{user_id}
Whether the user has started your bot and has not blocked it. Requires paid access in @BotMembersRobot. | Parameter | Required | What it is |
|---|---|---|
| code | yes | Bot code from @BotMembersRobot |
| user_id | yes | User's Telegram ID |
bash
curl https://api.botstat.io/checksub/BOT_CODE/123456789
Response
json
{
"ok": true
}
Errors
json
{
"ok": false,
"status_code": 403,
"description": "Forbidden: bot was blocked by the user"
}
| status_code | description | When |
|---|---|---|
| 401 | Unauthorized in members | Wrong code |
| 401 | Access denied, need payment | Access in @BotMembersRobot is not paid |
| 401 | Unauthorized | The bot token is no longer valid |
| 403 | Forbidden: bot was blocked by the user | The user blocked the bot |
| 400 | Bad Request: chat not found | The user has not started the bot |
| 504 | Timeout telegram answer | Telegram did not respond |
| 500 | error text | Another Telegram error |
Errors come with HTTP 200Check ok and status_code in the response body. If Telegram does not respond within 2 seconds, the request is retried up to 5 times, then status_code 504 comes back.
Was this article helpful?
Didn't find the answer? Contact support