Configuring App Identities
An App Identity is the "account" your integration uses to talk to Blink. Creating one gives you a Client ID and Client Secret. Navigate to Blink Admin portal and click Manage Apps > Created Apps > Create app. Choose App Identity option.
Fill in the details:
- Name: what the app is called (e.g. "Shift assistant").
- Tagline: a short description.
- Logo: an image for the app.
- Webhook URL: the web address where Blink will notify you when something happens (a new message is posted, or someone joins or leaves a chat). You can add this later if you don't have one yet.
- Events: these are webhook events that you can subscribe to:

Once your App Identity is configured, click Create - this will generate a Client ID and Client Secret which you will need to make authenticated API calls. The Client ID is also your App Identity ID used to manage the apps membership in Blink chat and sending messages.

Authentication
Before you can send or read messages, you need an access token. This is a short-lived token that is required to authenticate your API requests. You get one by sending your Client ID and Client Secret to Blink's token endpoint.
curl --location --request POST 'https://api.joinblink.com/oidc/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={client-id}' \
--data-urlencode 'client_secret={client-secret}'This will return a response like so:
{
"access_token": "ey...",
"expires_in": 300,
"refresh_expires_in": 0,
"token_type": "Bearer",
"not-before-policy": 0,
"scope": ""
}Use the value of access_token as a bearer token in the Authorization header of your Chat API requests.
Note: Tokens expire (the
expires_invalue is the number of seconds it lasts - 300 seconds is 5 minutes). When a token runs out, just request a new one the same way.
Updated 5 days ago