Skip to main content

Get started

Authentication

To use the Build Management API, you need to authenticate with an access token with specific scopes.

Get an access token with supported scopes

The Build Management API supports the the following read and write scopes:

ScopeDescription
buildmanagementservice.builds.readWith this scope you can:
- Get a list of build definitions, parameters, branches, and builds.
- Get a build by a specific build ID or build number.
- Access a list of artifacts.
- Download individual artifacts.
buildmanagementservice.builds.writeWith this scope you can run and cancel builds.

The above scopes need to be combined with one of the following additional scopes:

ScopeDescription
[tenant.{tenantId} + any.project]With this scope you can access a specific tenant and any star within this tenant.
[tenant.{tenantId} + project.{starId}]With this scope you can access a specific tenant and a specific star within this tenant.

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.{starId} {SCOPES}" \
--data-urlencode "client_id={GWHUB_CLIENT_ID}" \
--data-urlencode "client_secret={GWHUB_CLIENT_SECRET}" | jq -r '.access_token'

Where:

  • GWHUB_URL depends on your region. Use one of the following:

    RegionURL
    AMERhttps://guidewire-hub.okta.com/oauth2/aus11vix3uKEpIfSI357/v1/token
    CANADAhttps://guidewire-hub.okta.com/oauth2/aus11vix3uKEpIfSI357/v1/token
    EMEAhttps://guidewire-hub-eu.okta.com/oauth2/ausc2q01c40dNZII0416/v1/token
    SWITZERLANDhttps://guidewire-hub-eu.okta.com/oauth2/ausc2q01c40dNZII0416/v1/token
    APAChttps://guidewire-hub-apac.okta.com/oauth2/ausbg05gfcTZQ7bpH3l6/v1/token
    JAPANhttps://guidewire-hub-apac.okta.com/oauth2/ausbg05gfcTZQ7bpH3l6/v1/token
  • SCOPES can contain the buildmanagementservice.builds.read or buildmanagementservice.builds.write scope or both scopes.

  • GWHUB_CLIENT_ID is a unique identifier for the application that you use to obtain a token from Guidewire Hub.

  • GWHUB_CLIENT_SECRET is a secret for the application that you use to obtain a token from Guidewire Hub.


The response contains a JSON object with the requested access token:

Example response
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "xxxxxxxx",
"scope": "buildmanagementservice.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_MANAGEMENT_SERVICE_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:

RegionURL
AMERhttps://buildmanagementservice.api.omega2-andromeda.guidewire.net/
CANADAhttps://buildmanagementservice.api.omega2-butterfly.guidewire.net/
EMEAhttps://buildmanagementservice.api.omega2-cartwheel.guidewire.net/
SWITZERLANDhttps://buildmanagementservice.api.omega2-whirlpool.guidewire.net
APAChttps://buildmanagementservice.api.omega2-circinus.guidewire.net/
JAPANhttps://buildmanagementservice.api.omega2-milkyway.guidewire.net/

When the documentation refers to {baseUrl}, replace it with the correct URL for your region.