API Create User problem

Jump to solution
ellington
Community Explorer

Hello,

I seem to have run in to a snag when I create users in our canvas account and I'm hoping the group can lead me in the right direction. My problem is that I CAN create accounts through the canvas API but ALL of the fields are populated with the pseudonym unique_id.
I'm attempting to create a sample user by sending this json:
{"name":{"name":"Cpt. Ultron","sortable_name":"Ultron, Captain"},"pseudonym":{"unique_id":"ultron1"},"communication_channel":{"address":"ultron@hnu.edu","skip_confirmation":"true"}}

to this api uri:

 

and when I check the user that is created I see:

Full Name:ultron1
Display Name:ultron1
Sortable Name:ultron1
Default Email:ultron@hnu.edu

Please let me know if you would need any other information to help figure out what is going on here!

Thank you,

Jeremiah Ellington

Holy Names University

Oakland, Ca.

Labels (1)
1 Solution
James
Community Champion

 @ellington ,

The very first part should be called "user", not "name".

You have

{  
  "name":{ 
    "name":"Cpt. Ultron",
    "sortable_name":"Ultron, Captain"
  },
...
}

but it should be

{  
  "user":{ 
    "name":"Cpt. Ultron",
    "sortable_name":"Ultron, Captain"
  },
...
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

My guess is that in the lack of a "user" property, it's taking the user information from the pseudonym, where the unique_id is ultron1.

That said, if you fix it, it still may not work for ultron1. I've seen that unique_id give people trouble if they try to create it when it already existed and it wasn't always easy to get rid of.

View solution in original post