- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to a previous question I was able to update an assignments integration_data using :
assignment[integration_data]={"id":1XXXX,"heading":"My Heading"}
Now I need to do the same for an assignment group but none of the following variations have worked :
assignment_group[integration_data]={"id":1XXXX,"heading":"My Heading"}
assignment_groups[integration_data]={"id":1XXXX,"heading":"My Heading"}
integration_data={"id":1XXXX,"heading":"My Heading"}
I'm hoping someone here can point me in the right direction.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If its as parameters, break the data bit out into the parameters.
This worked for me:
curl -k $server/api/v1/courses/$course_id/assignment_groups/$assgrp_id \
-X PUT \
-F "integration_data[id]=123" \
-F "integration_data[heading]=Some Heading" \
-H "Authorization: Bearer $token"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to the docs (Assignment Groups - Canvas LMS REST API Documentation) the last one your have is correct. That is, just integration_data=...
What endpoint are you POSTing to and what do you get back? Do you get an error, or no error but the data aren't updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter,
thanks for the reply.
I'm PUTing to the edit Assignment Group Endpoint and the url looks like this :
I'm getting back "Invalid integration data" in Postman.
Using position works fine and returns the expected AssignmentGroup object :
Using any of the other options I have above also returns the expected AssignmentGroup object but with no change to the integration_data component.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, sorry about the POST, was looking at a creation.
Just tried an update using curl and sending json and it worked fine. It looked like:
json='{ "integration_data": {"id":"1XXXX","heading":"My Heading"} }'
curl -k $server/api/v1/courses/$course_id/assignment_groups/$assgrp_id \
-X PUT \
-H "Authorization: Bearer $token" \
-H "Content-Type: application/json" \
--data "$json"
If its objecting to the integration data, looking at the above, have you tried quotes around your "1XXXX"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, if your 1XXX is really all numbers the quote thing was a red herring.
I just tried sending the integration data as a body parameter rather than sending it all as json and I get the "Invalid integration data" message.
How are you sending it in Postman?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter,
I have been sending it as a parameter. Looking at your previous curl I figured I'll need to send it through as data and see if that works. I had tried the quotes for the id and that hadn't made a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If its as parameters, break the data bit out into the parameters.
This worked for me:
curl -k $server/api/v1/courses/$course_id/assignment_groups/$assgrp_id \
-X PUT \
-F "integration_data[id]=123" \
-F "integration_data[heading]=Some Heading" \
-H "Authorization: Bearer $token"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah that's the secret sauce I was looking for. Work perfectly when I break up the parameters like that. Thanks so much Peter.
