Thanks @garth and llawson
I am not wanting Postman to directly read the spreadsheet. I am using raw JSON in postman's body field to create the assignments with a POST action.
The problem i am having is correctly formatting the JSON in an error free way so the API can recognise the JSON and create the new assignments.
The initial data is in a spreadsheet, but I am transferring this to JSON using this tool: CSV To JSON Converter
But every attempt to format/re-format the JSON fails - for example when I attempt to POST the following JSON to https://<institution>.instructure.com/api/v1/courses/<courseid>/assignments :
{
"assignment": [
{
"name": "Review of Space I",
"points_possible": "75",
"due_at": "2016-01-31T00:00:00Z",
"published": true,
"submission_type": "on_paper",
"description": "<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week."
},
{
"name": "Review of Space II",
"points_possible": "75",
"due_at": "2016-02-07T00:00:00Z",
"published": true,
"submission_type": "on_paper",
"description": "<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week."
},
{
"name": "Motors & Generators I",
"points_possible": "65",
"due_at": "2016-02-14T00:00:00Z",
"published": true,
"submission_type": "on_paper",
"description": "<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week."
}
]
}
I get the following error:
{
"errors": [
{
"message": "An error occurred.",
"error_code": "internal_server_error"
}
],
"error_report_id": 580
}
I also get other errors when attempting other types of formatting - for example using an array format also provides the error:
{
"assignment": [
{
"name":["Review of Space I","Review of Space II","Motors & Generators I","Motors & Generators II","Motors & Generators III","Motors & Generators IV","Term 1 Exam","Review & M&G Practicals","Ideas to Implementation I","Ideas to Implementation II"],
"points_possible":["75","75","65","65","65","65","100","-","65","65"],
"due_at":["2016-01-31T00:00:00Z","2016-02-07T00:00:00Z","2016-02-14T00:00:00Z","2016-02-21T00:00:00Z","2016-02-28T00:00:00Z","2016-03-06T00:00:00Z","2016-03-13T00:00:00Z","2016-03-20T00:00:00Z","2016-04-03T00:00:00Z","2016-04-10T00:00:00Z"],
"published":[true,true,true,true,true,true,true,true,true,true],
"submission_type":["on_paper","on_paper","on_paper","on_paper","on_paper","on_paper","on_paper","on_paper","on_paper","on_paper"],
"description":["<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week.","<h4>Please print out and complete these homework assignments</h4>\n<p>Hand in to your mentor at the end of the due date week."]
}
]
}
So far the only format of JSON that has been successful has been this:
{
"assignment": {
"name": "Test assessment 1",
"submission_types": [
"none"
],
"points_possible": 1,
"grading_type": "points",
"due_at": "2015-10-18T00:00:00+01:00",
"muted": "true",
"published": "false"
}
}
But that only creates one assignment, where I need to create many.
Any Ideas?
Thanks again!