Get started
Authentication
To use the Build Promoter API, you need to authenticate with an access token with specific scopes.
Get an access token with supported scopes
The Build Promoter API supports the following scopes:
| Scope | Description |
|---|---|
buildpromoter.builds.read | Retrieve information about builds with all the GET endpoints. |
buildpromoter.builds.write | Promote a build. |
buildpromoter.builds.forcepromote | Promote a build regardless of the quality gate status. |
The above scopes need to be combined with the following scopes limiting the level of access by a tenant, star (logical star system), or star system (physical star system):
| Scope | Description |
|---|---|
tenant.{tenantId} + any.project | Get access to a specific tenant and any star (logical star system) to retrieve information about a build. |
tenant.{tenantId} + project.{starId} | Get access to a specific tenant and a specific star (logical star system) to retrieve information about a build. |
tenant.{tenantId} + project.{starId} + any.planet_class | Get access to a specific star (logical star system) to promote a build to pre-production and production star systems (physical star systems). |
tenant.{tenantId} + project.{starId} + planet_class.{dev|preprod|prod} | Get access to a specific star system (physical star system) to promote a build. The chosen planet_class should be a type of the star system (physical star system) to which you promote a build. |
To promote a build or promote a build regardless of the quality gate status, you need to have an access token with one of the following scopes:
any.planet_classplanet_class.{dev|preprod|prod}
To get an access token with scopes, you must authenticate with Guidewire Hub using your client ID and client secret. Send the following POST request:
curl -s --location --request POST $GWHUB_URL \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=tenant.{tenantId} project.{projectId} $SCOPES" \
--data-urlencode "client_id=$GWHUB_CLIENT_ID" \
--data-urlencode "client_secret=$GWHUB_CLIENT_SECRET" | jq -r '.access_token'
Where:
-
$GWHUB_URLdepends on your region. Use one of the following:Region URL AMER https://guidewire-hub.okta.com/oauth2/aus11vix3uKEpIfSI357/v1/tokenCANADA https://guidewire-hub.okta.com/oauth2/aus11vix3uKEpIfSI357/v1/tokenEMEA https://guidewire-hub-eu.okta.com/oauth2/ausc2q01c40dNZII0416/v1/tokenSWITZERLAND https://guidewire-hub-eu.okta.com/oauth2/ausc2q01c40dNZII0416/v1/tokenAPAC https://guidewire-hub-apac.okta.com/oauth2/ausbg05gfcTZQ7bpH3l6/v1/tokenJAPAN https://guidewire-hub-apac.okta.com/oauth2/ausbg05gfcTZQ7bpH3l6/v1/token -
$SCOPESis a list with at least one supported scope, separated by white spaces.Example:
buildpromoter.builds.read buildpromoter.builds.write.
The response contains a JSON object with the requested access token:
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "xxxxxxxx",
"scope": "scope=buildpromoter.builds.read tenant.{tenantId} project.{starId}"
}
Make an authorized call
To authorize the API requests, add the obtained access token to an Authorization header:
Authorization: Bearer {access_token}
For example:
curl -s --location --request GET "$BUILD_PROMOTER_URL" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Base URLs
Depending on your region, use one of the following base URLs:
| Region | URL |
|---|---|
| AMER | https://buildpromoter.api.omega2-andromeda.guidewire.net/ |
| CANADA | https://buildpromoter.api.omega2-butterfly.guidewire.net/ |
| EMEA | https://buildpromoter.api.omega2-cartwheel.guidewire.net/ |
| SWITZERLAND | https://buildpromoter.api.omega2-whirlpool.guidewire.net/ |
| APAC | https://buildpromoter.api.omega2-circinus.guidewire.net/ |
| JAPAN | https://buildpromoter.api.omega2-milkyway.guidewire.net/ |
When the documentation refers to {baseUrl}, replace it with the correct URL for your region.