Organization credentials
Create and manage organization API keys and OAuth clients.
Use organization credentials to query, upload, and publish your team's Read Pico software and to create or archive device software IDs. Owners and admins can create API keys and OAuth clients under My organizations → Field Lab → Organization → Credentials.
Create an API key
- Under API keys, select Create API key and name it
Field Lab Integration. - Copy the full key and store it in your server-side secrets manager. The full key is displayed once, when you create it.
- To replace a key, create a new one and update its consumers before revoking the old key.
Create an OAuth client
- Under OAuth clients, select Create OAuth client and name it
Field Lab Service. - Copy the client ID and client secret and store them on your server. These credentials use the OAuth 2.0
client_credentialsgrant. - After resetting the client secret, update the secret stored by your service. Delete the client when you retire it.
Request an access token
Enter your client ID and client secret. The form uses HTTP Basic authentication to request a token with organization:access. Select Copy access token after a successful response.
/api/authV2/oauth2/tokenSuccessful response
An excerpt from an HTTP 200 OK response is shown below. Use the returned expires_in value to determine the token lifetime. Repeat the request when you need a new token.
{
"access_token": "EXAMPLE_ACCESS_TOKEN",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "organization:access"
}| Error | What to check |
|---|---|
invalid_client | Check the client ID, the latest client secret, and the HTTP Basic authentication format. |
invalid_scope | Set scope to organization:access. |
invalid_grant | Check that the organization is active and use client_credentials. |
Keep API keys, client secrets, and access tokens in a controlled server-side environment.
Send your first request
Enter your organization API key or the OAuth access token you just obtained, then send the request.
/api/authV2/organization/software/projectsHTTP 200 returns your organization's Read Pico projects. If the array is empty, create your first device software ID. For HTTP 401, check the organization key or request a fresh OAuth access token. Scripts can also use x-api-key for API-key authentication. Send one credential per request.
Did this solve your problem?
Join our community