Raphael_Barreiros | 2016-07-14 18:36:09 UTC | #1
Hi, All!
We are developing an integration between another platform and Purecloud and we need to manage Purecloud users using the API, so any user created on the other platform is created on Purecloud as well.
Actually, we have succeeded on creating users using the API. However, when we try to update a user, we receive an error 500, which normally stands for "Internal Server Error".
We have revised our logic and parameters and we cannot find anything wrong on our side. Also, we cannot understand why this call is generating this error.
We have tried to get support from ININ offices on Brazil, but they weren't able to figure out this issue and they asked us to ask this question here.
Below you can see our request with our token removed for safety reasons. Also, the response we've received right after sending it.
Thanks in advance for any support.
Best regards,
Raphael Barreiros.
Request ------------------------------
https://api.mypurecloud.com/api/v2/users/<user-id>
Body:
{ "name": "Name Update", "chat": { "jabberId": "" }, "department": "TI II", "email": "user@dom.com.br", "addresses": [ { "address": "user@dom.com.br", "mediaType": "EMAIL", "type": "WORK2" } ], "title": "Mr", "username": "user@dom.com.br" }
Response ------------------------------
{ "status": 500, "code": "internal.server.error", "message": "The requested operation failed with status 500", "contextId": "f796eb03-7534-4662-8fdc-ed10da676266", "details": [], "errors": [] }
KevinGlinski | 2016-07-14 18:39:39 UTC | #2
Since it is a PATCH you only have to set the fields you want to update.
There is a parameter that wasn't documented which I submitted a fix for this morning called "version" you have to get the current user configuration which has the version property, then set the same value on the PATCH
e.g. { "title": "new title", "version": 1466 }
Raphael_Barreiros | 2016-07-14 18:57:55 UTC | #3
Dear Kevin,
First of all, thank you very much for your response.
I've retried the request but I am still getting the same error. See bellow, now without masking data:
request:
{ "name": "Name Update", "department": "TI II", "addresses": [ { "address": "aa@par.com.br", "mediaType": "EMAIL", "type": "WORK2" } ], "title": "Mr", "version": 2 }
response:
{ "status": 500, "code": "internal.server.error", "message": "The requested operation failed with status 500", "contextId": "1abd6f4e-9b6a-4e13-971a-0392123ac88d", "details": [], "errors": [] }
Any ideas?
KevinGlinski | 2016-07-14 19:22:27 UTC | #4
it looks to be an error updating the addresses, the backend service is throwing an exception, i'm able to reproduce but when i remove the address field it works. I will report to the dev team.
Raphael_Barreiros | 2016-07-14 19:46:31 UTC | #5
Dear Kevin,
You are right. I was able to successfully update the user after removing the address from the call.
Thanks a lot.
Best regards,
Raphael Barreiros.
KevinGlinski | 2016-07-14 20:31:17 UTC | #6
looks like WORK2 isn't valid for an email, WORK will work. We're updating the documentation for which value is valid for which media type
system | 2017-08-28 19:25:18 UTC | #7
This post was migrated from the old Developer Forum.
ref: 137