Get Sales Rep Company Access
Retrieves the access a sales rep has in one company, including which customers or customer roles they can work with.
HTTP Request
- URL:
/salesRep/{id}/companyAccess/{companyId} - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_CUSTOMERorREAD_WRITE_CUSTOMER
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the sales rep. |
companyId | String | Required. The ID of the company. |
cURL Example
curl --location '<BASE_URL>/salesRep/66b1c2d3e4f5a6b7c8d9e0f1/companyAccess/665434c100e82884676936b9' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The company access was returned successfully.
- 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or an ID is not valid.
- 404 Not Found: No sales rep matches the ID (
Sales Rep doesn't exist), or the sales rep has no access to the company (Company access not found for this sales rep).
Sample JSON Response
{
"success": true,
"data": {
"id": "66b1c2d3e4f5a6b7c8d9e0f2",
"salesRepId": "66b1c2d3e4f5a6b7c8d9e0f1",
"companyId": "665434c100e82884676936b9",
"accessType": "customer",
"customerIds": ["66a5023524b16685e42a1eda", "66a5023524b16685e42a1edb"],
"roleIds": [],
"company": {
"id": "665434c100e82884676936b9",
"name": "Northwind Supply",
"email": "purchasing@northwindsupply.com",
"phoneNumber": "9735550100",
"status": "active",
"isSubCompany": false
},
"createdAt": "2024-08-06T09:12:51.311Z",
"updatedAt": "2024-09-18T15:40:02.902Z"
}
}
Response Details
Company Access Data
The fields are the same as in Get All Sales Rep Company Access.
Notes
- Use Manage Sales Rep Company Access to grant or change this access.