This is driving me mad
I can add a URL topic, no problem.
However, adding a FILE topic is proving to be impossible, I always get a 400 error.
I tried postman, python, and curl.
Trying to stay as close to example in the documentation as possible. I know the URL is not correct for my instance.
curl --http1.1 --request POST \ ⇄
--url https://{{d2lhost}}/d2l/api/le/{{version}}/{{courseid}}/content/modules/{{moduleid}}/structure/ --header 'Content-Type: multipart/mixed; boundary=xxBOUNDARYxx' --data '--xxBOUNDARYxx
Content-Type: application/json
{"IsHidden": false, "IsLocked": false, "ShortTitle": "Test", "Type": 1,
"DueDate": null, "Url": "/content/extensibility/EXT-104/file.txt",
"StartDate": null, "TopicType": 1, "EndDate": null, "Title": "Test topic
content"}
--xxBOUNDARYxx
Content-Disposition: form-data; name=""; filename="file.txt"
Content-Type: text/plain
This is a sample text file
with some text content.
--xxBOUNDARYxx--'
I removed the authorization from the curl.
I always get back:
{'type': 'http://docs.valence.desire2learn.com/res/apiprop.html#invalid-parameters', 'title': 'Invalid Parameters', 'status': 400, 'detail': 'Request has missing or invalid parameters.'}