Applications
An application configures the set of ChatKitty resources related by an application ID and API key.
A ChatKitty application is needed to create users, channels, messages, etc. and interact with ChatKitty on behalf of your app.
If you have multiple deploy environments like development, staging, production, etc., we recommened a application per environment to isolate data.
Schema
id required | integer <int64> 64-bit integer identifier associated with this resource |
created_time required | string <date-time> ISO date-time this application was created |
key required | string Primary API key assigned to this application |
required | object Custom properties attached to this application |
Array of objects (Link) Hypermedia control links for this resource |
{- "id": 1,
- "key": "19b458d0-2b50-491c-8f13-65ec12f3978e",
- "properties": { },
- "created_time": "2020-10-02T20:29:25.316Z",
}
Creating an application
Create an application using the ChatKitty dashboard.
Application OAuth V2 credentials
ChatKitty expects a valid OAuth V2 Bearer access token issued on behalf of an application, using the client credentials flow to be included in all API requests related to the application.
Retrieve the OAuth V2 client ID and client secret needed to issue access tokens from the Dashboard, from the settings page.
Retrieving the authenticated application
To get the application authenticated, use the Platform API:
GET /v1/application
- cURL
- JavaScript
curl -X 'GET' \
'https://api.chatkitty.com/v1/application' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN'
// npm install chatkitty-platform-sdk
const chatkitty = new ChatKitty({
clientId: 'CLIENT-ID',
clientSecret: 'CLIENT-SECRET'
})
await chatkitty.Application.retrieveAuthenticatedApplication()
Retrieving application settings
To get the current setting for an application, use the Platform API:
GET /v1/application/settings
- cURL
- JavaScript
curl -X 'GET' \
'https://api.chatkitty.com/v1/application/settings' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN'
// npm install chatkitty-platform-sdk
const chatkitty = new ChatKitty({
clientId: 'CLIENT-ID',
clientSecret: 'CLIENT-SECRET'
})
await chatkitty.Application.retrieveAuthenticatedApplicationSettings()
Update application settings
You can change your application's configuration by updating the application's settings.
Using the Platform API:
PUT /v1/application/settings
- cURL
- JavaScript
curl -X 'PUT' \
'https://api.chatkitty.com/v1/application/settings' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"guestUsers": "DISABLED",
"userCreatedChannels": "DISABLED"
}'
// npm install chatkitty-platform-sdk
const chatkitty = new ChatKitty({
clientId: 'CLIENT-ID',
clientSecret: 'CLIENT-SECRET'
})
await chatkitty.Application.updateAuthenticatedApplicationSettings({
guestUsers: 'DISABLED',
userCreatedChannels: 'DISABLED'
})
Using the Dashboard