cancel
Showing results for 
Search instead for 
Did you mean: 
vRaj1
Community Participant

Sample Json for Create user

Jump to solution

Dear All,

I would like to create a user through API.  I'm referring to the below URL. 

https://canvas.instructure.com/doc/api/users.html#method.users.create

Could you please provide a sample Json to create a user or class.

Thanks.

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
James
Community Champion

@vRaj1 

In the documentation that you linked to, you will find the definitions for the request. I'll let you decide which ones are important for your institution.

Probably the most commonly missed idea is that the properties like user[name] need to be nested in JSON.

This may not hit all of the content that you need to set, but it should look something like this:

 

{
  "user" : {
    "name" : "John Smith",
    "skip_registration" : true
  },
  "pseudonym" : {
    "unique_id" : "jsmith",
    "password" : "changeMe",
    "sis_user_id" : 1234
  },
  "communication_channel" : {
    "type" : "email",
    "address" : "jsmith@example.com",
    "skip_confirmation" : false
  }
}

 

 

View solution in original post

2 Replies
James
Community Champion

@vRaj1 

In the documentation that you linked to, you will find the definitions for the request. I'll let you decide which ones are important for your institution.

Probably the most commonly missed idea is that the properties like user[name] need to be nested in JSON.

This may not hit all of the content that you need to set, but it should look something like this:

 

{
  "user" : {
    "name" : "John Smith",
    "skip_registration" : true
  },
  "pseudonym" : {
    "unique_id" : "jsmith",
    "password" : "changeMe",
    "sis_user_id" : 1234
  },
  "communication_channel" : {
    "type" : "email",
    "address" : "jsmith@example.com",
    "skip_confirmation" : false
  }
}

 

 

View solution in original post

vRaj1
Community Participant

Thank you, James it's working. 🙂

My case sis_user_id is alphanumeric so I put inside double-quote and it's working.