belaie | 2016-09-11 17:48:15 UTC | #1
It looks like we are not able to create new users with "Scandinavian characters" in their names using User Platform API.
Example:
ADD JSON => { "name": "Firstname Børseth", "department": "Sales", "email": "***", "title": "Manager", "password":"*****" }
Response:
{"status":400,"code":"bad.request","message":"The request could not be understood by the server due to malformed syntax.","contextId":"43a5175e-48d2-4d00-a4bc-4733f2b5823d","details":[],"errors":[]}</value>
We are having the same error with all users having scandinavian characters in their names,, Characters like "ÆØÅ" in their names;
How can we solve this?
anon84847021 | 2016-09-12 09:16:46 UTC | #2
I tried the following without issue:
POST /api/v2/users HTTP/1.1 Host: api.mypurecloud.ie Authorization: bearer XXXX Content-Type: application/json
{ "name": "Scandinavian ø User", "email": "scandinavian@gmail.com", "password": "AZAZFREhuihgfuire3454346@$" }
Are you sure your issue is related to the API and not the SDK?
tim.smith | 2016-09-12 14:29:14 UTC | #3
This worked fine for me:
{
"name": "Firstname Børseth",
"department": "Sales",
"email": "****",
"title": "Manager",
"password":"1234ABCDabcd!@#$"
}
You could try using postman or the API Explorer (what I used) to verify that the request works successfully for you. It seems that your request isn't being sent correctly.
belaie | 2016-09-12 18:14:22 UTC | #4
Thats great. Is it possible for us to see incoming request from us and tell us what we are missing in the request?
KevinGlinski | 2016-09-12 18:42:53 UTC | #5
Which environment/region are you connecting to?
belaie | 2016-09-12 18:43:58 UTC | #6
We are trying to connecto to => api.mypurecloud.ie
KevinGlinski | 2016-09-12 18:44:28 UTC | #7
if you remove the ø or other scandinavian chars, does the request work? There is a known issue where if the password isn't complex enough then the server will return a 4xx but still create the user.
belaie | 2016-09-12 18:48:17 UTC | #8
If do find/replace Scandinavian characters to normal characters than it works without actually password being complex or not complex.
KevinGlinski | 2016-09-12 19:03:07 UTC | #9
The error is, Invalid UTF-8 start byte 0xf8
the error happens before the message body is traced out so i can't see what is being sent across the wire. Looks like you are using Apache-HttpClient but not our java sdk right? @tim.smith do you have an easy script to create a user with our sdk? I'm guessing the problem is with that http client
belaie | 2016-09-12 19:08:14 UTC | #10
Yes, you are correct, I am using Apache Http Client. Actually I am using a 3rd party software which under the hood uses Apache Http Client. So I do not have so much control, but If I know what is being missing under the road, I can create a support ticket for that vendor.
tim.smith | 2016-09-12 21:39:31 UTC | #11
The Java SDK uses the Apache Http Client also, and I was able to reproduce this error. The fix is to specify the encoding on the POST body. I've fixed this in the SDK here: https://github.com/MyPureCloud/purecloud_api_sdk_java/commit/4bb4792d0332ab8b528d0b7ebbee6c1957c2294c#diff-28d1eba3f72cfd0c6f76424ab88d59ae
belaie | 2016-09-12 22:03:46 UTC | #12
What should I change from my side?. We are not using Java SDK from Purecloud. but using Platform API through a 3rd part software which utlizes the Apache Http Client. The only possiblity from my side to change contents in the Headers and Payloads.
tim.smith | 2016-09-12 22:08:16 UTC | #13
I'm not familiar with your 3rd party software, so I can't advise exactly what you need to change. You can see my code change to the handling of the POST body in the github commit I linked though. Perhaps the author of the 3rd party can look at that commit and see what they need to do to their library if you are unable to make the change yourself.
system | 2017-08-28 19:27:08 UTC | #14
This post was migrated from the old Developer Forum.
ref: 386