- 13 Mar 2023
- DarkLight
Setting Up an API Access Token
- Updated on 13 Mar 2023
- DarkLight
The Expedient Enterprise Cloud (EEC) offers a full REST API interface for use in your programming language of choice. A Postman collection with several useful requests and pre-configure environment variables is available at https://apidocs.expedient.cloud.
Setting up API access and authenticating with the API via an access token
In order to access the REST API you will need to create an access token for the user you will be using. This user can be either an AD account or a vCD local account. If you will be accessing the API via automation software it may be preferred to create a dedicated service account first. When creating a service account please keep in mind that this account will have access to your Enterprise Cloud via the public Internet and so should be secured with a long and complex password that is not reused elsewhere. When creating the user, set the user role to a role containing the necessary permission set for your use case.
Once the user has been created, log into the EEC portal as that user. If you are using a vCD local account rather than an AD account, enter the username and password on the login page rather than choosing the “sign in with single sign-on” option.
Once logged in as your new user, open the dropdown menu next to the username in the top right and select User preferences.
On the User preferences page, click New under the Access Tokens section.
On the Create General Token dialog box, enter a descriptive name for your token (for example: the name of your automation server). Once you click Create you will be provided with a token string (aka refresh token). Make sure to store this refresh token in a safe place where you can access it. Once you close the dialog box, you will not be able to retrieve the token again. The refresh token you created will be used to authenticate against the /oauth/tenant/{tenant name}/token endpoint to receive an access token for your API session. The Postman collection documentation goes into greater detail on this process.