Prepare an API Key
Your backend uses an API Key to request a document URL and to call the status, save, and download APIs. Create a key before trying Upload & Edit. You do not need to connect storage for this first workflow.
Create a key
- Sign in to Developer Console.
- Open API Keys and select Create API Key.
- Enter a name that identifies the application using the key. Add a description if needed, and choose an expiration.
- Create the key and copy its secret value into your backend's secret storage. Do not use the key's display name or ID as the secret.
The key must remain active when your backend calls an API. Keep the same key available while its document sessions are in use: a different key, even from the same account, cannot access those sessions.
Do not include the secret in browser JavaScript, a mobile application, source control, logs, or document URLs. Your application must authenticate its users and check their document permissions before requesting an Office URL. The API Key identifies your Developer Console account; it does not perform those checks for your users.
Authenticate API requests
The guides use $THINKFREE_API_KEY to refer to a secret loaded into your backend environment. Send its value in the Authorization header when calling https://api.thinkfree.com:
Authorization: Bearer <YOUR_API_KEY>
Do not send this header when the user's browser opens the returned browser.openUrl. That URL opens Office; the separate api URLs are backend API endpoints and require the key.
Next: upload and edit one file
Follow Upload & Edit to send a document and open the returned URL. This workflow requires one supported Office file and no storage setup. After trying it, connect your own storage if your application needs to reopen documents and save changes to their original location.