https://public-api.staging.workchats.com), never a real company. See
Sandbox for how to get access.
1
Register your App
Octogle registers an App that any company can install. Tell your Octogle
contact:
- the App’s name (shown on the consent screen and on every message it sends)
- the OAuth redirect URI your backend will receive
codeon
client_id and a client_secret, and access to a sandbox
company with a staging App registration. Tokens issued in the sandbox are
prefixed wc_bot_test_ rather than wc_bot_live_, so they’re easy to tell
apart in logs.Keep client_secret server-side. It’s a credential, not something to ship
in a browser or mobile build.Building an App only your own company will use? Your company admins
register it themselves. See
Build an App for your own company.2
Install on the sandbox
Send the company admin to the sandbox authorize URL,
The admin sees a consent screen naming your App and the scopes it’s asking
for, and picks which groups and channels the bot may join. On approval,
Workchats redirects to This token doesn’t expire and there’s no refresh token — save it now.
Reinstalling later keeps the same bot user but issues a new token, and the
old one stops working (
https://app.staging.workchats.com/oauth/authorize (in production it’s
https://app.workchats.com/oauth/authorize), with:redirect_uri?code=<code>&state=<state>.Exchange the code for a token:200
401 token_revoked). Replace the stored token
whenever you finish a new install.3
Confirm the token works
200
app_id is your App’s client_id. A message your bot sent carries the
same value in its app_id, so your App can recognise its own messages.4
Send a DM
Look up a recipient by email, then send:The
201
Idempotency-Key matters as soon as you retry on a timeout. See
Idempotency before you write real send logic.Next
- Sending messages covers
blocks, edits and deletes. - Errors lists every code you can get back.
- Concepts explains Apps, installations and scopes in more depth.