[ARCHIVED] Bad request when posting user against rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2021
03:37 AM
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
07: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.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.