- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2021
02:37 AM
Bad request when posting user against rest api
Dear Community,
I'm trying to create a user with Canvas rest api. Here's the json I'm posting:
{
"user":{
"Name":"Foo bar"
},
"pseudonym":{
"Unique_id":"foobar@mailinator.com"
}
}
And here's the response from Canvas:
{
"errors": {
"user": {
"pseudonyms": [
{
"attribute": "pseudonyms",
"type": "invalid",
"message": "invalid"
}
]
},
"pseudonym": {
"unique_id": [
{
"attribute": "unique_id",
"type": "invalid",
"message": "invalid"
},
{
"attribute": "unique_id",
"type": "too_short",
"message": "too_short"
}
]
},
"observee": {},
"pairing_code": {},
"recaptcha": null
}
}
I've tried a lot of different syntaxes but with the same result. Please help.
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2021
06:48 AM
Thanks @dtod for your reply!
I managed to figure out what was wrong. `Unique_id` needs to be in lowercase. Since I pass `Unique_Id` I guess Canvas gott `null` and went "well, this ID is way to short!"
So all is well, for now.