More In-depth Example #587
-
All the python we are using here has been generated in-house and, so far, has not had to get seriously complex in any of our SAaS interfaces. Seeing a full package like this seems to be life saver for a smaller school like ours. But consuming a package such as this is giving me a couple stumbling blocks I haven't experienced so I was hoping it would not be out of line to request an example of an implementation. I have test scenarios doing several of the get_ routines and this validates my use of the overall structure. But I do not understand the requirements to do something like a create_user(). The business rules to ensure the User() defined below has valid content is the easy part. Once populated, I'm not clear how to implement the Create_User() method to create the user in Canvas. I believe with an example of creating a user with these attributes, the rest of the pieces should fall into place. I chose this example because of the different layers of data in the create user call. Since the various API structures appear similar in nature, I thought if I were to see an example with a user as sampled below, expanding to courses, crosslists, sections and the like would be fairly straightforward.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Note: I have referenced the documentation such as those at Examples. Where the challenges arise is for a parameter such as enable_sis_reactivation which is not at a lower level or setting the email when the communication_channel does not seem to be a part of the parameters to pass into the create_user implementation. The other item is, when I've implemented |
Beta Was this translation helpful? Give feedback.
-
So after playing this weekend, I need to answer my own question. A comment made by a developer at another school made me reread the provided examples and, yes, it comes down to grasping the concept being used with CampusAPI. As stated in the documentation, it all starts with an instance of Canvas. From there all other major tools must be instantiated. This is the point that I missed with the examples. All my test "gets" worked with the instance of canvas but I missed the point that account, course, user, etc are all instantiated from the instance of canvas. Yes, I know, that is clearly shown in the create_user example but sometimes you get blinded by what you are use to doing. I've only dealt with the SIS Imports load sheets so Accounts in my mind was far more limited than the API definition so I misunderstood the example. So if anyone else needs a hand-held example, the answer to my own question is straight forward. This successfully creates a user using all levels of attributes of the call.
I do appreciate the work and the willingness to publish such a complete set of APIs. As stated earlier, this will make such a difference for us. |
Beta Was this translation helpful? Give feedback.
So after playing this weekend, I need to answer my own question. A comment made by a developer at another school made me reread the provided examples and, yes, it comes down to grasping the concept being used with CampusAPI. As stated in the documentation, it all starts with an instance of Canvas. From there all other major tools must be instantiated. This is the point that I missed with the examples. All my test "gets" worked with the instance of canvas but I missed the point that account, course, user, etc are all instantiated from the instance of canvas. Yes, I know, that is clearly shown in the create_user example but sometimes you get blinded by what you are use to doing. I've only d…