client.Bots (BotsClient).
Methods
CreateBotAsync
POST /2/bots
Create a Bot
Creates a bot account in the calling app’s project and returns its bearer token. Idempotent on handle: repeating the request for a handle that already names one of the project’s bots returns that bot with a freshly minted token, revoking the previous one — safe to retry when a response was lost, since the replaced token was never seen. With an OAuth 2.0 user token, the user must be an admin of the project’s developer account. On API Connect, where the request bills the user’s own account, the bot is created in the user’s project instead; its token is still minted for the calling app.
Parameters
Returns:Task<CreateBotResponse>
DeleteBotAsync
DELETE /2/bots/{id}
Delete Bot
Deletes a bot account from the calling app’s project. With an OAuth 2.0 user token, the user must be an admin of the project’s developer account. On API Connect, where the request bills the user’s own account, the bot is deleted from the user’s project instead.
Parameters
Returns:Task<DeleteBotResponse>
GetAsync
GET /2/bots
Get Bots
Retrieves the bot accounts in the calling app’s project. meta.max_bots is the most bots the project can have.
Parameters
Returns:Task<GetBotsResponse>
RevokeBotTokenAsync
DELETE /2/bots/{id}/token
Revoke Bot Token
Revokes a bot’s bearer token. The bot account is kept, and rotating its token mints a new one.
Parameters
Returns:Task<RevokeBotTokenResponse>
RotateBotTokenAsync
POST /2/bots/{id}/token
Rotate Bot Token
Mints a new bearer token for a bot and invalidates every token previously issued for it. The new token is returned only once.
Parameters
Returns:Task<RotateBotTokenResponse>
UpdateBotAsync
PUT /2/bots/{id}
Update Bot
Updates a bot’s handle, display name, or who may send it Direct Messages.
Parameters
Returns:Task<UpdateBotResponse>