Get started
Authentication
To use the Repository Settings API, you need to authenticate with an access token:
- For user-service interactions, copy your user access token directly from a given application in Guidewire Home.
- For service-to-service interactions, use your client credentials to get a token with specific scopes. For details, see Before you begin.
Before you begin
If you use the service-to-service interactions with the Repository Settings API for the first time:
- Decide which scopes you need.
- Register the API in Guidewire Hub. For details on how to register the API, see Access Cloud Platform APIs in the Cloud Platform documentation.
If you already registered the Repository Settings API and obtained the necessary credentials:
- Get an access token with the supported scopes.
- Use the generated token to make an authorized call.
User access token
To authenticate with a user access token, you must be in the user group managed by Guidewire Hub. For details, see Access Cloud Platform apps and services.
An access token expires after 60 minutes.
You can get an access token directly from Guidewire Home:
-
Log in to Guidewire Home.
In Guidewire Home, from Apps
, select Repository Settings or select it from your pinned apps.
-
Select your profile.
-
Select
Copy access token.
This action copies an access token to your clipboard.
Supported scopes
The Repository Settings API supports the following scopes:
| Scope | Description |
|---|---|
scms.repositories.read | List all the active repositories in a star system. |
scms.branchutils.read | Get branch configuration for a repository. |
scms.branchutils.write | Modify branch configuration for a repository. |
scms.defaultreviewers.read | List all conditions configured for a repository. |
scms.defaultreviewers.write | Create, update, and delete conditions. |
scms.mergechecks.read | Get a merge check configuration. |
scms.mergechecks.write | Update and remove merge check configuration. |
scms.branchpermissions.read | List all branch restrictions for a repository. |
scms.branchpermissions.write | Create, update, and delete branch restrictions. |
scms.defaulttasks.read | List all tasks for a repository. |
scms.defaulttasks.write | Create, update, and delete tasks. |
scms.deletionaftermerge.read | Check the default behavior for deleting source branches after merging a pull request. |
scms.deletionaftermerge.write | Set the default behavior for deleting source branches after merging a pull request. |
scms.automerge.read | Check the automatic merge configuration for a repository. |
scms.automerge.write | Enable or disable automatic merge configuration for a repository. |
Get an access token with supported scopes
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=${SCOPE} tenant.${TENANT_ID} project.${PROJECT_ID}" \
--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:Region URL AMER https://guidewire-hub.okta.com/oauth2/aus11vix3uKEpIfSI357/v1/tokenBRAZIL 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 -
${SCOPE}must includetenant.${TENANT_ID},project.${PROJECT_ID}, and at least one of the supported scopes. For details on how to get or extend scopes, see Access Cloud Platform APIs. -
${GWHUB_CLIENT_ID}is a unique identifier for the application that you use to obtain a token from Guidewire Hub. For details on how to get the client ID, see Access Cloud Platform APIs. -
${GWHUB_CLIENT_SECRET}is a secret for the application that you use to obtain a token from Guidewire Hub. For details on how to get the client secret, see Access Cloud Platform APIs.
The response contains a JSON object with the requested access token:
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "xxxxxxxx",
"scope": "scope=scms.mergechecks.read tenant.${TENANT_ID} project.${PROJECT_ID}"
}
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 "${REPOSITORY_SETTINGS_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://scmservice.api.omega2-andromeda.guidewire.net |
| BRAZIL | https://scmservice.api.omega2-sculptor.guidewire.net |
| CANADA | https://scmservice.api.omega2-butterfly.guidewire.net |
| EMEA | https://scmservice.api.omega2-cartwheel.guidewire.net |
| SWITZERLAND | https://scmservice.api.omega2-whirlpool.guidewire.net |
| APAC | https://scmservice.api.omega2-circinus.guidewire.net |
| JAPAN | https://scmservice.api.omega2-milkyway.guidewire.net |
When the documentation refers to {baseUrl}, replace it with the correct URL for your region.