Bridgit Bench’s open API provides users with the framework to develop custom integrations between their tech stack and Bridgit Bench. Users are able to build customized connections and develop new applications using the Bridgit Bench API.
Bridgit 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 Bridgit Bench account. If you’re planning to build your own applications, the Bridgit Bench API allows you to leverage your resources within the app using conventional HTTPS requests in a RESTful architecture.
When you’re ready to start using the Bridgit Bench API to leverage your current tech stack, you’ll first need to contact Bridgit to be given an invite to join Bridgit Bench so you can set up a service account. WARNING: You’ll need to request admin permission on your Bridgit Bench account in order to create the service account.
Once the invite has been received and you’ve successfully logged in, follow these steps 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 'username=someone@example.com' --data-urlencode 'password=[...snip...]'
Authentication Response Example:
{ "access_token": "[...snip...]", "token_type": "Bearer", “refresh_token”: "[...snip...]", "expiry": "2019-07-23T21:43:03.413440849Z"}
Once you have this bearer token, you’ll have to include in all other requests made against the Bridgit 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’s 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’ve 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": "jayne@example.com", "name": "Jayne Peters", "title": "Project Engineer" }'
Response body with 201 status code
{
"id": "1",
"email": "jayne@example.com",
"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": "jayne@example.com",
"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 clicking here.