List a site contact's cost centres
const url = 'https://api2.recruso.co.uk/v1/clients/1/sites/1/contact-persons/1/cost-centres';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api2.recruso.co.uk/v1/clients/1/sites/1/contact-persons/1/cost-centres \ --header 'Authorization: <Authorization>'Returns every cost centre linked to one contact at one of your own agency’s sites.
This list is not paged and takes no filters. Each entry carries the link’s own id, which is what RemoveSiteContactCostCentre takes, not the cost centre id.
The list carries ids only. Read the cost centres themselves through the branch’s cost centre endpoints for their names and details.
The client, site and contact in the route must line up — the site must belong to the client and the contact to the site — and any mismatch returns 404 rather than 403.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The clientId path parameter
The siteId path parameter
The contactPersonId path parameter
Responses
Section titled “Responses”OK
Every cost centre linked to the site contact. Not paged.
object
The cost centres linked to this contact, as link records.
One cost centre linked to the site contact.
object
The link’s own identifier. This is what RemoveSiteContactCostCentre takes, not the cost centre id.
The site contact the cost centre is linked to.
The cost centre being linked. Must belong to the same branch as the site.
Example
{ "costCentres": [ { "contactPersonCostCentreId": 204, "contactPersonId": 88, "costCentreId": 19 } ]}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
