How to interact with the Kinetic Platform's Discussions API
Discussions
Discussions provides real time chat functionality within the Kinetic Platform. Discussions can be tied to other objects within the system like Forms, Teams, and Submissions.
Authentication
Create OAuth Client
- From the space administrator consoles, navigate to Space > Settings > OAuth.
- Click Add OAuth Client to create an OAuth client.
- Give the client a descriptive name, like "Integeration User".
- Configure Client ID to match the username of the user account.
Note: The username, and subsequently Client ID may only contain alphanumeric characters. - Configure Client Secret to be the password of the user account above.
- Set Redirect URI to "/app/oauth/callback".
- Click Save Client.
Obtain OAuth Token
To fetch the OAuth token, make an HTTP POST request using the credentials configured above for HTTP Basic Auth to the following endpoint: <SERVER>/app/oauth/token?grant_type=client_credentials&response_type=token
where <SERVER>
is something like https://my-space-slug.kinetic-platform-location.com
.
If successful, the response will contain JSON data with the token stored in the access_token
property.
POST https://my-space-slug.kinetic-platform-location.com?grant_type=client_credentials&response_type=token
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6ImJlbnMtaW50ZWdyYXRpb24tdXNlciIsImRpc3BsYXlOYW1lIjoiYmVucy1pbnRlZ3JhdGlvbi11c2VyIiwiZW1haWwiOiIiLCJleHAiOjE1ODc0NDMyMjYsImlzcyI6ImtpbmV0aWMtZGF0YSIsInNwYWNlQWRtaW4iOnRydWUsInNwYWNlU2x1ZyI6InVhdCIsInVzZXJuYW1lIjoiYmVucy1pbnRlZ3JhdGlvbi11c2VyIn0.GDfzsN_mTmDy3pmhlVhb3-BenU_I0sZYLFVtpG5GD-Y",
"token_type": "bearer",
"expires_in": 43199,
"scope": "full_access",
"spaceSlug": "acme",
"displayName": "integration-user",
"iss": "kinetic-data",
"spaceAdmin": true,
"email": "",
"username": "integration-user"
}
JavaScript Example
const result = axios.post(
// Compute OAuth endpoint.
`${server_variable}/app/oauth/token?grant_type=client_credentials&response_type=token`,
// No body data is required.
{},
// Configure basic auth.
{
auth: {
username: username_variable,
password: password_value,
}
}
)
Ruby Example
RestClient::Resource.new(
# Compute OAuth endpoint.
"#{server_variable}/app/oauth/token?grant_type=client_credentials&response_type=token",
# Configure basic auth.
user: username_variable,
password: password_variable
)
result = resource.post({ accept: :json, content_type: :json })
Using the OAuth Token
When making API calls, the value of the access_token
should be passed in as a Bearer Token (the value of the Authorization
header should be Bearer <ACCESS_TOKEN>
).
Response Format
All responses will be returned using the JSON format.