AnsweredAssumed Answered

How do I use API to change end date in bulk for quizzes?

Question asked by Stephen Rhea on Dec 28, 2018
Latest reply on Jan 4, 2019 by Stephen Rhea

I apologize if this question is very simple but I am new to api, so I am hoping to get an easy answer.

 

I am trying to automate an api process using Postman to update quiz[lock_at] dates for all courses within a Sub-Account. I have figured out how to do it individually but I am having difficulties defining the property to automate it and move the api from one course to the next, changing the quizzes in the subaccount. Here is what I have in "Tests" for my GET request.

 

// Parsing the response returned by the request.
var jsonData = pm.response.json();

// Extracting the token from the response and setting it as a global variable.
pm.globals.set("newcourse_id", jsonData.course["id"]);

The response I am getting in the Test Results is 

There was an error in evaluating the test script:  TypeError: Cannot read property 'id' of undefined

I know the issue is with my defining the Canvas Course ID, but I admit I am lost. Any assistance would be great, or if anyone already has a code/collection on how to update all quiz dates in a Sub-Account, that would be great.

Outcomes