Authentication
Send the workspace API token in the Authorization header of every request: Authorization: Bearer <token>.
curl https://api.officelycrew.com/v1/offices \ -H "Authorization: Bearer $OFFICELY_API_TOKEN"Address
Section titled “Address”The API is at https://api.officelycrew.com. Integrations built on the earlier address, https://api.getofficely.com, keep working for now: move them to https://api.officelycrew.com when you can. Tokens, endpoints, limits and errors are the same on both.
Tokens
Section titled “Tokens”An Account Admin creates the token. The token identifies the workspace, so there’s no workspace or account ID to send.
| Rule | Detail |
|---|---|
| Tokens per workspace | One active token at a time. Revoke it before creating a replacement |
| Name | 1 to 80 characters, for example “reporting” |
| Seeing the token | Shown once, when it’s created. We store only a hash of it |
| Scope | The workspace that created it. Read-only |
| Availability | Private beta. To join, contact support and ask for API tokens to be turned on for your workspace |
The token can read reports for the whole workspace. Office, team and person filters narrow the results, not what the token can read.
Keep it safe
Section titled “Keep it safe”- Keep tokens out of URLs, query strings, shared documents, tickets and front-end code.
- Store it in a password manager or your integration’s secret store.
- If it leaks, revoke it straight away and create a new one. Anything using the old token stops working.
Replace a token
Section titled “Replace a token”Only one token can be active, so replacing it means a short gap. Revoke the old token, create a new one, then update your integration.
When the token is wrong
Section titled “When the token is wrong”An invalid or revoked token gets 401:
{ "error": { "code": "UNAUTHORIZED", "message": "A valid API token is required." }}A request without an Authorization: Bearer header also gets 401 UNAUTHORIZED, with the message “A bearer token is required.”
Interactive docs
Section titled “Interactive docs”The interactive docs at /docs list every endpoint and parameter. Select Authorize, paste the token without Bearer, then use Try it out. The token stays in the page’s memory and is gone when you reload.
Calling from a browser
Section titled “Calling from a browser”Browser requests are allowed only from Swagger Editor at https://editor.swagger.io, which can load /openapi.json and make GET requests. Other browser origins get no CORS permission, so call the API from a server or script, not from a web page.
Related
Still need help? Chat to our support team.
Contact support