Bloomreach Cloud API
The API documentation is available at https://api.<stack-name>.bloomreach.cloud/v3/docs. In order to determine the stack name, the easiest is to look at the URL of Mission Control: the word that comes after 'https://missioncontrol.' is the stack name.
It is best to use HTTP 1.1 to access the API to avoid side-effects of HTTP 2. Also notice that when doing CI/CD, the authentication token expires after 10 minutes, so it is best to have a single function that takes cares of the login and refresh of the token when 9 minutes have elapsed (see API docs on /v3/authn/refresh_token).
On a UNIX system, you can use curl to make API calls from the command line.
First, log in:
$ curl -X POST -H "Content-Type: application/json" -d '{"username":"[email protected]","password":"yourpassword"}' https://api.<stack-name>.bloomreach.cloud/v3/authn/access_token
Note the authentication token in the response:
{"token_type":"Bearer","access_token":"eyJhbG.......nkwZUWBBc","refresh_token":"d0ce....8cc3ee7c6"}
Next, use the authentication token from the previous response in subsequent calls.
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'
You can also use the following script to add new user, though you require groovy to execute it. Replace the desired value in 'apiBase', you are good to add new users. Note that it does not do error handling/feedback very well.
Tip: make sure you do not add a trailing slash to the end of the path. This will result in an error.