ipperson@User returned as userId by REST API

Lex Clay shared this problem 2 years ago
Resolved

Hi guys,

Creating a user in a client org via the REST API.

Get security token via /api/refresh-tokens with the body


{

"userName":"admin@domain.co.uk",

"password":"password",

"clientOrgRef":"testRefId"

}


Create user in client org via /api/admin/users?uniqueUsers=true & the body


[{

"userId":"bob@testpie.com",

"emailAddress":"bob@testpie.com",

"roleCode":"YFREPORTCONSUMER",

"password":"test",

"firstName":"Bob",

"lastName":"PieTester",

"languageCode":"EN",

"timeZoneCode":"GMT"

}]


Attached is the response I get....any idea what I've done wrong or if it's a bug...?


Lex

Replies (4)

photo
1

Hello Lex,

I am investigating this and will let you know what I find out.

Regards,

David

photo
1

Hi Lex,

Sorry for the delay in getting back to you. I'm having problems getting my Postman testing to work. I just wanted to let you know I hadn't forgotten about you!

I'll continue working on it and I'll let you know as soon as I have something.

David

photo
1

Hi David,

I've identified the root cause of the issue. It only happens when uniqueUsers=true flag is sent in the URL. Removing that flag creates the user correctly. Looking at it, there's no need for that flag anyway, you get a bad request response if the email address is already in use.

It's up to you if you continue with looking at it mate but from my side, I have a workaround that means I don't need the fix so you can close this request.

Thanks anyway chap.

Lex

photo
photo
1

Hi Lex,

Thank you for the update. I'm glad you are up and running!

I'm still going to chase up why the userID is different when uniqueUsers=true flag is sent. I'm curious now! I'll let you know what I find out.

David

photo
1

Hi Lex,

I have confirmed this is intended functionality. When using uniqueUser, the username assigned is <ipid>@User to ensure unique id’s. This was a feature of the SOAP webservices. When used with allow duplicate emails, it means that the onboarding would not throw an error if an existing username was used.

Have a good one!

David

Leave a Comment
 
Attach a file