Getting started
Create a service account, get an access token and make your first Cloud API call.
The Cambrionix Connect Cloud API lets your own servers, scripts and pipelines manage the hubs,
computers and devices in your organisation. It is a set of JSON REST APIs under
https://connect.cambrionix.com/api, one for each area of Connect, such as the
Hardware API for hubs, ports and devices.
1. Create a service account
Cloud API calls are made by a service account in your organisation, not by a person.
- In Connect, open Integrations and choose Create custom integration.
- Give it a name, and choose the groups that grant its permissions. Pick only what your code needs.
- Copy the Service ID, which is your client ID, and the client secret. The secret is shown only once; store it as you would a password.
You also need your organisation ID, from Settings → General Settings in Connect.
2. Get an access token
Exchange the client credentials for an access token. Each token is for one API, named by its
audience; this one is for the Hardware API:
curl -X POST "https://connect.cambrionix.com/api/v1/organizations/$CONNECT_ORGANIZATION_ID/oauth2/token" \ -H "Content-Type: application/json" \ -d '{"grant_type": "client_credentials", "client_id": "'"$CONNECT_CLIENT_ID"'", "client_secret": "'"$CONNECT_CLIENT_SECRET"'", "audience": "b2d57903-6cc0-4099-aeaa-926d441a4128", "scope": "*"}'
The response contains an access_token and expires_in, its lifetime in seconds. Every API's
audience is listed on its page in the API reference, and
Authentication explains tokens and scopes.
3. Make a call
Send the token in the Authorization header. List the hubs in your organisation. Signed in with
your Connect account, you can run it here against your own organisation:
Try it
curl -X GET "https://connect.cambrionix.com/api/hardware/v1/hubs?limit=10" \ -H "Authorization: Bearer $CONNECT_ACCESS_TOKEN"
Next steps
- Browse the Cloud API reference for every endpoint, each with an example request you can run.
- Download an API's OpenAPI document from its reference page to generate a client or import it into tools such as Postman.
- Working on a computer with hubs attached? The Cambrionix CLI controls them from a terminal.