![Logo](/content/logo.png)
Authentication
Gocious API uses OAuth access token to authenticate requests. This document provides instructions on how to obtain an access token to access Gocious APIs.
How to register your client application with Gocious to secure your REST requests
Login to your Gocious workspace and Navigate to Tools->Integrations
![](/content/Integrations.png)
Click on the Custom API card and enter the connection name and click on Save and Generate Secret button. Once the integration is created in the same screen you can retrieve Client Id , Client Secret and the Subscription Key. Note down these values and store them securely. This information is visible only when you set up the integration. So it is important that you copy these values and store them securely. However you can regenerate these values in case you forget or if you think the secret is being compromised.
![](/content/Create Integration.png)
Acquire an access token
Once you register application in Gocious workspace. You can call the below api to get the access token using client id and secret.
Url : https://enter.gocious.net/oauth/token
Http Method : Post
Content-Type : application/json
Request Body :
{
"client_id": "enter your client id here",
"client_secret": "enter your client secret here",
"audience": "GociousOpenAPI",
"grant_type": "client_credentials"
}
Response :
{
"access_token": "access_token returned",
"expires_in": 3600,
"token_type": "Bearer"
}
Send API Request
Once you acquire an access token , you can make calls to Gocious Open API using the access token and the subscription key.
Below is the sample API request to Patch a Milestone. You can find all the available API list in the APIs menu. You can also find the details about the API request and response and you can also try the APIs in same page.
Request Url : https://api.gocious.io/openapi/productlines/{your-productline-id}/milestones/{your-milestone-id}
Headers:
Ocp-Apim-Subscription-Key : {your subscription-key}
Content-Type : application/json
Authorization : Bearer {acces_token}
Request Body :
{
"name" : "milestone name ",
"stage" : "ca7135eb-d0b6-4427-a9ab-3526411ac26e",
"eventDate" : "2029-02-28"
}
Response :
{
"transactionId": "f59cbdf6-ad25-495c-9281-d278627068eb"
}