ForumCategory: OtherUnexpected behaviour for ‘userprofile.SetUserProfile’
Patrick asked 49 years ago

I am trying to extend the following sample app created by LivePerson: https://developers.liveperson.com/messaging-window-api-samples-javascript-sample.html
I need to set some extra information about the customer so that I can help him better. So I noticed this function: userprofile.SetUserProfile
The documentation I used for this is: https://developers.liveperson.com/connector-api-api-reference-conversation.html
After many attempts (from various sample apps, documentation pages and just common sense) I finally got to a point where it is at least picking up some of my properties. I am sending:

socket.setUserProfile({
firstName: 'John',
lastName: 'Doe',
phone: '0612345678',
role: 'CONSUMER',
description: 'Test Description!'
});

The resulting status code is 200 and the body is “OK User Profile set successfully“. So this makes me believe that everything is okay and I am good to go, right? WRONG!
In the LiveEngage dashboard I can see that the first name and last name are concatenated and the description is used as “Consumer ID“?
The rest is forgotten? Or just not shown?

Anyway, I am now trying to retrieve this information in my Bot using:

agent.getUserProfile(originatorId, (error, profile) => {...});

The resulting information stored in the profile variable is:

[{
    "type": "ctmrinfo",
    "info": {
        "imei": "0612345678"
    }
}, {
    "type": "personal",
    "personal": {
        "firstname": "John",
        "lastname": "Doe",
        "contacts": [{
            "phone": "0612345678"
        }]
    }
}]

I am now trying to figure out what happened, because apparently LivePerson did all sorts of unexpected things to my profile data:

So I have a couple questions:

  1. Where is the up-to-date and correct documentation? I just wasted a day on doing trial-and-error runs to find out what is going on…
  2. Can the response for userprofile.SetUserProfile please be updated so that it states what has happened? For example it could return the output of a getUserProfile call?
  3. Is there a way to send properties that are unknown by the setUserProfile API?
  4. Why is my description used as Consumer ID in LiveEngage?
  5. Why is my phone used as IMEI?
  6. How can I choose whether to store information in the ctmrinfo object or the personal object?

Kind regards, Patrick