How to get the last Service Advisor for a Customer
This document is designed to help you understand how you can fetch the last Service Advisor who worked with a customer at a dealership. The advisor is determined from the customer's most recent Repair Orders (ROs) and is always an advisor of the dealer's Service department. To use this endpoint, you first need your credentials. If you don't already have them, head over to the Authentication and Authorization page to see how you can request credentials from us.
Parameters Used
Path parameters
| Parameter Name | Value | Description | Required |
|---|---|---|---|
departmentUUID | String | Unique identifier of dealer department. It is used to identify the dealer; the advisor is always looked up in the dealer's Service department | Yes |
customerUUID | String | Unique identifier of the customer at the dealer | Yes |
Authorization
| Parameter Name | Description | Required |
|---|---|---|
{{basic_auth_token}} | Authorization: Base64 encoded string using Service Subscriber Username and password | Yes |
Scope
This request requires the following authorization scopes:
| Scope | Level | Description |
|---|---|---|
user.list | DealerDepartment | Authorizes client to read user details for provided dealer department |
Endpoint
curl -X GET "https://api.mykaarma.com/order/v2/department/{{departmentUUID}}/customer/{{customerUUID}}/lastServiceAdvisor" \
-H "authorization: {{basic_auth_token}}"
This endpoint does not take a request body or query parameters.
How the advisor is determined
- The dealer is identified from the
departmentUUID. - The customer's 10 most recent Repair Orders at that dealer, which have been synced with the DMS, are looked up, newest first.
- The advisor of each of these ROs is checked in order. The first advisor who belongs to the dealer's Service department and is currently active is returned.
- If none of these advisors qualifies, the response is returned without advisor details. Repair Orders older than the 10 most recent are not considered.
Response
Response Object
{
"statusCode":"integer",
"errors":[
{
"errorCode":"string",
"errorDescription":"string",
"errorUID":"string"
}
],
"warnings":[
{
"warningCode":"string",
"warningDescription":"string"
}
],
"dealerAssociateUuid":"string",
"advisorDetails":{
"userUuid":"string",
"departmentUuid":"string",
"firstName":"string",
"lastName":"string"
}
}
Sample Response Object
Advisor found
{
"statusCode":null,
"errors":null,
"warnings":null,
"dealerAssociateUuid":"4f1c2a7e9b3d4e8f8a6b5c4d3e2f1a0b",
"advisorDetails":{
"userUuid":"9a8b7c6d5e4f40312a1b0c9d8e7f6a5b",
"departmentUuid":"1e2d3c4b5a6f47889a0b1c2d3e4f5a6b",
"firstName":null,
"lastName":null
}
}
No advisor found
Returned with HTTP 200 when no qualifying advisor is found. This also happens when the customer has no Repair Orders at the dealer, or when no customer with the given customerUUID exists at the dealer.
{
"statusCode":null,
"errors":null,
"warnings":null,
"dealerAssociateUuid":null,
"advisorDetails":null
}
Response Object Explanation
| Field | Type | Description |
|---|---|---|
dealerAssociateUuid | String | Unique identifier of the advisor as a dealer associate of the Service department. null if no advisor was found |
advisorDetails | Advisor | Details of the advisor. null if no advisor was found |
advisorDetails.userUuid | String | Unique identifier of the advisor's user |
advisorDetails.departmentUuid | String | Unique identifier of the department the advisor belongs to |
advisorDetails.firstName | String | Currently not populated; always null |
advisorDetails.lastName | String | Currently not populated; always null |
statusCode | Integer | Currently not populated; always null |
errors | List<ApiError> | Error details, if the request failed |
warnings | List<ApiWarning> | Currently not populated; always null |
Important Note
- A
200response withoutadvisorDetailsdoes not tell whether the customer exists. Treat it as "no advisor available". - Advisor details are cached for a few hours, so a change to an advisor's status may take some time to be reflected.