Bloomreach Cloud API
Access the Bloomreach Cloud API documentation at https://api.<stack-name>.bloomreach.cloud/v3/docs.
To identify your <stack-name>, check the URL in Mission Control. The segment immediately following https://missioncontrol. is your stack name.
Use HTTP 1.1 when making API requests. HTTP 2 may cause unexpected behavior.
Authentication tokens expire after 10 minutes. For CI/CD workflows, implement a function that handles login and refreshes the token after 9 minutes. Refer to the API documentation for /v3/authn/refresh_token for details.
Making API Calls with curl
On UNIX systems, use curl to interact with the API from the command line.
1. Authenticate
Send a POST request to retrieve an access token:
$ curl -X POST -H "Content-Type: application/json" -d '{"username":"[email protected]","password":"yourpassword"}' https://api.<stack-name>.bloomreach.cloud/v3/authn/access_token
The response includes authentication tokens:
{"token_type":"Bearer","access_token":"eyJhbG.......nkwZUWBBc","refresh_token":"d0ce....8cc3ee7c6"}
2. Use the Access Token
Include the access_token from the previous response in the Authorization header for subsequent requests.
For example, to upload a distribution:
curl -H "Authorization: Bearer eyJhbG.......nkwZUWBBc" -X POST https://api.<stack-name>.bloomreach.cloud/v3/distributions -F 'dist_file=@/path/to/distribtution/distribution.tar.gz'
The -F option in curl sets the correct content type for file uploads. If you use other tools, consult the API and tool documentation to construct the request properly.
Adding Users with a Script
You can add new users using the provided Groovy script.
Update the apiBase variable with your API base URL before running the script. Groovy is required to execute the script. The script does not provide detailed error handling or feedback.
Continuous Deployment Example
For an example of setting up continuous deployment with the Bloomreach Cloud API, see Set up Continuous Deployment of your brXM Project in brCloud using Jenkins on the Bloomreach Developer Blog.
Important
Do not add a trailing slash to API endpoint paths. Including a trailing slash will result in an error.