you’re doing it wrong…now I can explain you why.
Basically you’re calling the Chat-api with an APIkey as authentication, which is mean to be used for services like Data-api, where the behaviour (the contenf of the responses) is independent from the caller.
For the Chat-api you need to use an
access_token, which is a token that is gained trough an OAuth flow, where a user log-in and explicitly approve your app to write inside chatrooms using his account. These token are often called “on behalf of the user”.
So here are the steps to make it working:
- Create an OAuth2 Clients Id from the developer portal (not an API key) with the scopes you need for your project (e.g. you can ask permissions for only reading chat, not writing and so on). Remember that the users will be prompted to approve these permissions, so usually…more you ask, less users will approve your app
- Implement an Oauth flow (implicit flow or authorization code flow) following our guides
- When is working, users will be prompted to login into FACEIT and approve you app using the consent screen
- If a user approve, an
access_token will be returned to the
redirect_uri you specified on the developer portal. This token is “on behalf of the user”, so you can use it for writing inside chatrooms in the name of the user.