8868体育 Bench鈥檚 open API provides users with the framework to develop custom integrations between their tech stack and 8868体育 Bench. Users are able to build customized connections and develop new applications using the 8868体育 Bench API.
8868体育 Bench API endpoints give you the ability to easily make calls to retrieve information and/or execute actions on the projects and people in your 8868体育 Bench account. If you鈥檙e planning to build your own applications, the 8868体育 Bench API allows you to leverage your resources within the app using conventional HTTPS requests in a RESTful architecture.
When you鈥檙e ready to start using the 8868体育 Bench API to leverage your current tech stack, you鈥檒l first need to contact 8868体育 to be given an invite to join 8868体育 Bench so you can set up a service account. WARNING: You鈥檒l need to request admin permission on your 8868体育 Bench account in order to create the service account.
Once the invite has been received and you’ve successfully logged in, follow聽聽to create a service account that will allow you to be authenticated through the API.聽WARNING: You’ll need to set up the service account with admin permission in order to modify or create new data through the API.
You can now use the service account credentials to be authenticated through the API.
API requests are authenticated using an OAuth bearer token. In order to get a token you need to authenticate your user by sending a POST request to /auth/signin
with your service accounts “unique identifier” and “password” parameters form-encoded in the body of the request. The response will be a JSON object including an “access_token” property.
curl -X POST https://bench.gobridgit.com/auth/signin -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode '[email protected]' --data-urlencode 'password=[...snip...]'
Authentication Response Example:
{ "access_token": "[...snip...]", "token_type": "Bearer", 鈥渞efresh_token鈥�: "[...snip...]", "expiry": "2019-07-23T21:43:03.413440849Z"}
Once you have this bearer token, you鈥檒l have to include in all other requests made against the 8868体育 Bench API. You will also have the refresh token which can be exchanged for another bearer token without providing your username and password again.
Every user can have up to 3 active sessions and each session is generated each time the request is made to /auth/signin
. Each additional session will remove the existing oldest active session. In order to end your session, send a request to /auth/signout
.
For security purposes, each session will expire after 24 hours if there鈥檚 no activity with that session token; otherwise, the session will continuously refresh itself on each request. After the session has expired, the user will be required to sign in again or exchange their refresh token for a new session. Refresh tokens are valid for 7 days from the time of issue and may be used only once.
We鈥檝e added a few examples of API requests below, but for the most part you are able to modify and create people, project, and role data. All these requests should be made to sub-paths of /rp/api/v1/
and all must include an authorization header which include the bearer token we mentioned earlier.
Refresh tokens may be exchanged for a new session by making a POST to the /auth/token endpoint like this:
POST /auth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=tGzv3**KW
Project examples
Create a project
curl -X POST https://bench.gobridgit.com/rp/api/v1/accounts/1/projects \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{ "name": "Ahrens Lofts", "colour": "#4B6BAA", "startDate": "2019-01-01", "endDate": "2020-12-31" }'
Response body with 201 status code
{
"id": "1",
"name": "Ahrens Lofts",
"colour": "#4B6BAA",
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"state": "Active",
"unfilledRoles": 0,
"totalRoles": 0,
"issuesCount": 0,
"lastModifiedOn": "2019-01-01T00:00:00Z"
}
Update a project
curl -X PATCH https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{"name": "Ahrens Lofts", "colour": "#0F6BAA", "startDate": "2019-04-01", "endDate": "2020-10-31" }'
Response body with 200 status code
{
"id": "1",
"name": "Ahrens Lofts",
"colour": "#0F6BAA",
"startDate": "2019-04-01",
"endDate": "2020-10-31",
"state": "Active",
"unfilledRoles": 0,
"totalRoles": 0,
"issuesCount": 0,
"lastModifiedOn": "2019-01-01T00:00:00Z"
}
Remove a project
curl -X DELETE https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1 -H 'Authorization: Bearer [... token ... ]'
Empty response body with 204 status code
People examples
Create a person
curl -X POST https://bench.gobridgit.com/rp/api/v1/accounts/1/persons \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{ "email": "[email protected]", "name": "Jayne Peters", "title": "Project Engineer" }'
Response body with 201 status code
{
"id": "1",
"email": "[email protected]",
"name": "Jayne Peters",
"title": "Project Engineer",
"photoUrl": "",
"state": "Active",
"hasConflict": false,
"lastModifiedOn": "2019-10-01T00:00:00Z"
}
Update a person
curl -X PATCH https://bench.gobridgit.com/rp/api/v1/accounts/1/persons/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{ "Jayne Peterson", "title": "Project Coordinator" }'
Response body with 200 status code
{
"id": "1",
"email": "[email protected]",
"name": "Jayne Peterson",
"title": "Project Coordinator",
"photoUrl": "",
"state": "Active",
"hasConflict": false,
"lastModifiedOn": "2019-10-01T19:18:02.946Z"
}
Remove a person
curl -X DELETE https://bench.gobridgit.com/rp/api/v1/accounts/1/persons/1 -H 'Authorization: Bearer [... token ... ]'
Empty response body with 204 status code
Role examples
Create a role
curl -X POST https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1/roles \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{ "name": "Project Engineer", "startDate": "2019-01-01", "endDate": "2020-12-31", "allocations": [{"startDate": "2019-01-01", "endDate": "2020-12-31", "allocatedPercent": 100 ] }'
Response body with 201 status code
{
"id": "1",
"name": "Project Engineer",
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"isFilled": false,
"allocations": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"allocatedPercent": 100
}
],
"unfilledRanges": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31"
}
]
}
Create multiple roles
curl -X POST https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1/roles/bulk \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '[{ "name": "Project Engineer", "startDate": "2019-01-01", "endDate": "2020-12-31", "allocations": [{"startDate": "2019-01-01", "endDate": "2020-12-31", "allocatedPercent": 75 ] },{ "name": "Project Coordinator", "startDate": "2019-01-01", "endDate": "2020-12-31", "allocations": [{"startDate": "2019-01-01", "endDate": "2020-12-31", "allocatedPercent": 50 ] }]'
Response body with 201 status code
[
{
"id": "2",
"name": "Project Engineer",
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"isFilled": false,
"allocations": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"allocatedPercent": 75
}
],
"unfilledRanges": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31"
}
]
},
{
"id": "3",
"name": "Project Coordinator",
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"isFilled": false,
"allocations": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"allocatedPercent": 50
}
],
"unfilledRanges": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31"
}
]
}
]
Update a role
curl -X PUT https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1/roles/1 \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [... token ... ]' \
-d '{ "name": "Project Engineer", "startDate": "2019-01-01", "endDate": "2020-12-31", "allocations": [{"startDate": "2019-01-01", "endDate": "2020-12-31", "allocatedPercent": 75 }] }'
Response body with 200 status code
{
"id": "1",
"name": "Project Engineer",
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"isFilled": false,
"allocations": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31",
"allocatedPercent": 75
}
],
"unfilledRanges": [
{
"startDate": "2019-01-01",
"endDate": "2020-12-31"
}
]
}
Remove a role
curl -X DELETE https://bench.gobridgit.com/rp/api/v1/accounts/1/projects/1/roles/1 -H 'Authorization: Bearer [... token ... ]'
Empty response body with 204 status code
View the API documentation by .