Help with Postman and course import

Richard.R.305
Richard.R.305 Posts: 19 🌱
edited July 5 in Social Groups
Hi, I am trying to use the "Create a new course import job request" api: https://docs.valence.desire2learn.com/res/course.html#post--d2l-api-le-(version)-import-(orgUnitId)-imports-

Has anyone successfully used this API endpoint using Postman?

I'm using Postman 10.15.4. My API call authenticates but after a few seconds (evidently after the transfer of the zip file), I get a 400 - bad/missing parameters - response.

Any help or pointers would be appreciated. Or if this is not the correct place for these questions? (I've looked at the "simple file upload" doc, but still not sure about the headers.)

(I'm working on what will eventually be a stand-alone service that automates uploading SCORM packages to Brightspace, fyi)


Here are my Postman settings:
{
"info": {
"_postman_id": "99f4aa69-7318-4db9-a746-8c1eba2244e5",
"name": "UCAR",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "12949045"
},
"item": [
{
"name": "import",
"protocolProfileBehavior": {
"disabledSystemHeaders": {
"content-type": true
}
},
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "redirect_uri",
"value": "https://mySite/callback",
"type": "string"
},
{
"key": "clientSecret",
"value": "blahblah",
"type": "string"
},
{
"key": "clientId",
"value": "blahblahblah",
"type": "string"
},
{
"key": "accessTokenUrl",
"value": "https://auth.brightspace.com/core/connect/token",
"type": "string"
},
{
"key": "authUrl",
"value": "https://auth.brightspace.com/oauth2/auth",
"type": "string"
},
{
"key": "useBrowser",
"value": false,
"type": "boolean"
},
{
"key": "scope",
"value": "import:job:create",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
},
{
"key": "headerPrefix",
"value": "Bearer",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "multipart/form-data; boundary=xxBOUNDARYxx",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "--xxBOUNDARYxx",
"value": "",
"type": "text"
},
{
"key": "Content-Disposition",
"value": "form-data; name=\"file\"; filename=\"BlahBlahUploadFile.zip\"",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/zip",
"type": "text"
},
{
"key": "",
"type": "file",
"src": "/Users/richardrussell/Downloads/BlahBlahUploadFile.zip"
},
{
"key": "--xxBOUNDARYxx--",
"value": "",
"type": "text"
}
]
},
"url": {
"raw": "https://mySite/d2l/api/le/1.70/import/6606/imports/?callbackUrl=https://mySite/callback",
"protocol": "https",
"host": [
"lms",
"meted",
"ucar",
"edu"
],
"path": [
"d2l",
"api",
"le",
"1.70",
"import",
"6606",
"imports",
""
],
"query": [
{
"key": "callbackUrl",
"value": "https://mySite/callback"
}
]
},
"description": "import"
},
"response": []
}
]
}

Richard
Tagged: