Get the list of bots.
None.
200 OK
401 Unauthorized
403 Forbidden
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/bot/list
Get the bot by id.
| Name | Type | Description |
|---|---|---|
| id | string |
The id of the bot |
200 OK
401 Unauthorized
403 Forbidden
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/bot/list/5a9b1b9b0f1b9c0001b5b0b0
Create a new bot.
| Name | Type | Description |
|---|---|---|
| name | string |
The name of the bot |
| description | string |
The description of the bot |
| isActivated | boolean |
The activation status of the bot |
| permissions | ClientPermissions |
The permissions of the bot |
201 Created
400 Bad Request (and error message in body)
401 Unauthorized
403 Forbidden
Get the API key of the bot by id.
| Name | Type | Description |
|---|---|---|
| id | string |
The id of the bot |
200 OK (and API key in body)
401 Unauthorized
403 Forbidden
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/bot/getApiKey/12345678-1234-1234-qwer-123456qwerty
Regenerate the API key of the bot by id.
| Name | Type | Description |
|---|---|---|
| id | string |
The id of the bot |
201 OK (and new API key in body)
400 Bad Request (and error message in body)
401 Unauthorized
403 Forbidden
404 Not Found
curl -i
-X PUT
-H "Content-Type: application/json"
http://localhost:3000/api/bot/regenerate/12345678-1234-1234-qwer-123456qwerty
| Name | Type | Required | Description |
|---|---|---|---|
| id | string |
Yes | The id of the bot |
| name | string |
No | The name of the bot |
| description | string |
No | The description of the bot |
| isActivated | boolean |
No | The activation status of the bot |
| permissions | ClientPermissions |
No | The permissions of the bot |
200 OK (and updated bot in body)
400 Bad Request (and error message in body)
401 Unauthorized
403 Forbidden
404 Not Found
Delete the bot by id.
| Name | Type | Description |
|---|---|---|
| id | string |
The id of the bot |
200 OK (and deleted bot id in body)
400 Bad Request (and error message in body)
401 Unauthorized
403 Forbidden
404 Not Found
curl -i
-X DELETE
-H "Content-Type: application/json"
http://localhost:3000/api/bot/delete
-d '{"id": "12345678-1234-1234-qwer-123456qwerty"}'
If you need to use the API from the bot client, you need to specify your API key in the x-api-key field in the request header.
For exapmle:
curl -i
-X GET
-H "Content-Type: application/json"
-H "x-api-key: 12345678-1234-1234-qwer-123456qwerty"
http://localhost:3000/api/object/get/[object_id]
This request will return the object with the specified id.
Get the token for the bot.
| Name | Type | Description |
|---|---|---|
| ip | string |
The IP address of the bot |
| event | string |
The event name. It`s custom for each bot |
200 OK (and token in body)
400 Bad Request (and error message in body)
401 Unauthorized
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/bot/oath2/token?ip=10.0.1.2&event=EnableOTA
Verify the token for the bot. This method is used to verify the token in the bot client.
| Name | Type | Description |
|---|---|---|
| code | string |
The token for the bot |
| event | string |
The event name |
200 OK (and token in body)
400 Bad Request (and error message in body)
401 Unauthorized
404 Not Found
curl -i
-X GET
-H "Content-Type: application/json"
http://localhost:3000/api/bot/oath2/verify?code=Z7GhouOfR3iSoIC&event=EnableOTA