Skip to main content

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 NameValueDescriptionRequired
departmentUUIDStringUnique identifier of dealer department. It is used to identify the dealer; the advisor is always looked up in the dealer's Service departmentYes
customerUUIDStringUnique identifier of the customer at the dealerYes

Authorization​

Parameter NameDescriptionRequired
{{basic_auth_token}}Authorization: Base64 encoded string using Service Subscriber Username and passwordYes

Scope​

This request requires the following authorization scopes:

ScopeLevelDescription
user.listDealerDepartmentAuthorizes 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​

  1. The dealer is identified from the departmentUUID.
  2. The customer's 10 most recent Repair Orders at that dealer, which have been synced with the DMS, are looked up, newest first.
  3. 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.
  4. 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​

FieldTypeDescription
dealerAssociateUuidStringUnique identifier of the advisor as a dealer associate of the Service department. null if no advisor was found
advisorDetailsAdvisorDetails of the advisor. null if no advisor was found
advisorDetails.userUuidStringUnique identifier of the advisor's user
advisorDetails.departmentUuidStringUnique identifier of the department the advisor belongs to
advisorDetails.firstNameStringCurrently not populated; always null
advisorDetails.lastNameStringCurrently not populated; always null
statusCodeIntegerCurrently not populated; always null
errorsList<ApiError>Error details, if the request failed
warningsList<ApiWarning>Currently not populated; always null

Important Note​

  • A 200 response without advisorDetails does 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.