Basic overview
The Data Cloud API is a collection of HTTP RPC-style methods, all with URLs in the form https://yourinstance.getdx.net/api/METHOD_FAMILY.method
. While it's not a REST API, those familiar with REST should be at home with its foundations in HTTP.
When sending a HTTP POST, you may provide your arguments as either standard POST parameters, or you may use JSON instead. Use HTTPS, SSL, and TLS v1.2 or above when calling all methods.
Authentication
Obtain API keys from the Data Cloud under the API Keys section. To authenticate your API requests, include your API key as a bearer token in the header of your request.
Authorization: Bearer your_api_key_here
Making requests
Requests can be sent as JSON or as URL-encoded form data. Ensure to set header Content-Type: application/json
when sending JSON
Here's a quick example of creating a deployment record:
curl -X POST https://yourinstance.getdx.net/api/deployments.create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_bearer_token_here" \
--data '{
"reference_id": "globally-unique-identifier",
"deployed_at": 1680723287,
"service": "my_service",
"commit_sha": "d1a34f0"
}'
And an example using URL-encoded:
β
curl -X POST -H "Authorization: Bearer your_bearer_token_here"\
https://yourinstance.getdx.net/api/deployments.create?\ reference_id=globally-unique-identifier\
&deployed_at=1680723287\
&service=my_service&\
commit_sha=d1a34f0
Evaluating responses
Responses from the API are in JSON format. Successful requests return an ok: true
status, while errors provide ok: false
with an error code and message.
HTTP Status Codes
200
- Request succeeded.422
- There was an error with your request.
Success Response Body
The response will always contain an ok
property which is true
when it is successful. This is in addition to the 200 OK
status.
{ "ok": true }
Error Response Body
When there is an error, the ok
property will be false
and details about the error will be included.
{
"ok": false,
"error": "invalid_arguments"
}