Hi,
I am trying to create a user using REST API.
I am using POSTMAN app.
I am using following
https://xxxdev.autodeskplm360.net/api/rest/v1/users
Content-Type = application/json
{
"user":[
{
"firstName": "PLM",
"lastName": "User02",
"licenseType": {
"value": "S",
"label": "Standard"
},
"userStatus": {
"value": "Y",
"label": "ACTIVE"
},
"resetPasswordOnNextLogin": false,
"email": "plmuser02@xxx.com",
"organization": "",
"address1": "",
"address2": "",
"city": "",
"state_prov": "",
"country": "",
"postal": "",
"userTimeZone": {
"value": "America/Los_Angeles",
"label": "Pacific Standard Time"
},
"showThumbnailPreference": "Y",
"uomPreference": {
"value": "metric",
"label": "Metric"
}
}
]
}
I keep getting following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<errors
xmlns:ns2="http://ns.autodesk.com/storage/v1">
<httpStatusCode>400</httpStatusCode>
<error>
<message>Invalid request {0}</message>
</error>
</errors>
Can someone please guide me to correct payload format.
Regards,
Ravi
Solved! Go to Solution.
Solved by dahalb. Go to Solution.
Hi ravidalli:
Missing in your request are some required fields: loginName, password
The required fields are: loginName, password, firstName, lastName, email and licenseType
These fields should also be unique: loginName, email
Please try your request as follows:
POST rest/v1/users
Content-Type: application/json
Data:
{
"loginName":"MyLoginName",
"password":"secret?",
"firstName":"plm",
"lastName":"360",
"licenseType":{
"value":"S"
},
"userStatus":{
"value":"Y"
},
"email":"plm360@email.com",
"userTimeZone":{
"value":"Canada/Eastern"
},
"showThumbnailPreference":"N",
"uomPreference":{
"value":"metric"
}
}
A successful response, if your loginName and email is unique would be an HTTP status code of 201, with a header value "Location" pointing to the URL of the newly created user.
Thank you, I was able to create using the payload, it also works well with our single sign on integration.
Regards,
Ravi