API / Projectroles

Projectroles endpoint enables you to get role information and manage projectroles in Silverbucket's database. Endpoint's URL is:
https://<your_environment_url>/customer-api/1.0/projectroles/




GET


When calling /projectroles/ endpoint without parameters you will get all the projectroles from database. Example response:
{
"count": 1,
"csvUrl": "/customer-api/1.0/projectroles/?csv=true",
"itemsPerPage": 500,
"excelUrl": "/customer-api/1.0/projectroles/?excel=true",
"next": null,
"current": 1,
"lastPage": 1,
"data": [
{
"id": 38725,
"hourly_rate": null,
"hourly_rate_inherited": "100.00",
"hourly_rate_multiplier": "1.000000",
"hour_budget": null,
"note": null,
"active": true,
"is_external": false,
"competency_query": null,
"role": 1,
"project": 1,
"user": 1,
"task": null,
"node": null,
"competency_requirement": null,
"request": []
}
],
"previous": null
}



POST


You can add projectroles with POST method to the same URL than get. POST body contains new projectrole's data in JSON format. Successful call will give response code 201 and return the newly created projectrole's JSON. Minimum JSON for adding a projectrole is:
{
"project": "<project_id>",
"role": <role_id>
}