Cannot lookup users via email using API (in order to get their ID), then unique_id edits, but..

40 views
Skip to first unread message

DallasRay.com, Inc. Accounts

unread,
Nov 2, 2020, 4:07:15 PM11/2/20
to SherpaDesk API

Cannot lookup users via email using API (in order to get their ID), then unique_id will update via the API but not location_id and location_name.

I have to get this sorted out before adding more agents and remote assistance folks.

Thank you in advance!

DallasRay.com, Inc. Accounts

unread,
Nov 2, 2020, 4:24:33 PM11/2/20
to SherpaDesk API
This is my call (ignore  the backslashes, I need to escape stuff on the platform I'm using which is RapidIdentity).

[
    {
        "name": "httpPUT",
        "outputVar": "result_put",
        "args": [
            {
                "name": "url",
                "value": "\"https://\"+Global.SherpaDeskOrgKey+\"-\"+Global.SherpaDeskInstanceKey+\":\"+Global.SherpaDeskAPIKey+\"@api.sherpadesk.com/profile/1409657?format=json\""
            },
            {
                "name": "data",
                "value": "{\"id\" : \"1409657\", \"email\" : \"acco...@dallasray.com\", \"unique_id\" : \"bigdrs\", \"location\" : 193025 }"
            }
        ]
    }
]

And this is what I  get returned:


statusCode=406.0, statusReason=No parameters provided to Profile. Nothing to change!}  

DallasRay.com, Inc. Accounts

unread,
Nov 2, 2020, 4:55:44 PM11/2/20
to SherpaDesk API
OK I got step one done using a GET with this.

"https://"+Global.SherpaDeskOrgKey+"-"+Global.SherpaDeskInstanceKey+":"+Global.SherpaDeskAPIKey+"@api.sherpadesk.com/api/users?email=Lorem...@dallasray.com&format=json"

That gets me the right user,  where i can grab the "id"

But getting 

statusCode=500.0, statusReason=FormatException}  

when doing  a  PUT with

URL
"https://"+Global.SherpaDeskOrgKey+"-"+Global.SherpaDeskInstanceKey+":"+Global.SherpaDeskAPIKey+"@api.sherpadesk.com/api/users/"+record[0]['id']+"&format=json"

Data
{"location_id" : 193026, "unique_id" : "bigdrs"}

And that returns

statusCode=500.0, statusReason=FormatException}

Eugene

unread,
Nov 3, 2020, 5:52:24 AM11/3/20
to SherpaDesk API
Hi,

problem with your request URL, 
   you use PUT /api/users/1411649&format=json
correct is PUT /api/users/1411649?format=json

please use question mark after  ID in address

Eugene

понедельник, 2 ноября 2020 г. в 23:55:44 UTC+2, DallasRay.com, Inc. Accounts:
Message has been deleted
Message has been deleted
Message has been deleted

Eugene

unread,
Nov 3, 2020, 3:03:18 PM11/3/20
to SherpaDesk API
​Hi,

1) First you need to know that unique_id belongs to User Profile, so you need to use PUT /profile/{user_id}

2) User's account and locations belong to User object so you do correct call:

3) You get old data after update because we use cache to prevent system outage on many same repeat call. If you need fresh data immediately you need to use &c=1 parameter.
Be careful with it, system update cache each 1-5 minutes automatically

4) For the same actions we have bulk update commands. please look https://github.com/sherpadesk/api/wiki#bulk-operat...

Thanks for your interest in SherpaDesk
Eugene.


вторник, 3 ноября 2020 г. в 12:52:24 UTC+2, Eugene:
Reply all
Reply to author
Forward
0 new messages