I am trying to submit an API call via the TeamDynamix API and it is a call to upload a file attachment.
From their documentation (https://api.teamdynamix.com/TDWebApi/Home/AboutFileSubmission), you need to structure the API call as follows (there’s also an Auth header with "bearer " but I have that taken care of):
Content-Type: multipart/form-data; boundary=CHANGEME
--CHANGEME
Content-Disposition: form-data; name="aeneid.txt"; filename="aeneid.txt"
Content-Type: application/octet-stream
FORSAN ET HAEC OLIM MEMINISSE IUVABIT
--CHANGEME--
I haven’t encountered a request like this with that “boundary” parameter or whatever it’s called. I’ve been playing around in Postman and I just can’t get it formatted right; the closest I get returns a “415 Unsupported Media Type” response.
What I’ve done is set the Authorization in the Header tab, then go to the Body tab and select “raw” and then paste in that text from above. The HTTP request (click Code, then HTTP) looks fine to me but I’m getting that “415” response. Here’s the HTTP request code generated:
POST /the/api/url HTTP/1.1
Host: the.host.name
Authorization: Bearer *Token goes here*
Content-Type: multipart/form-data; boundary=CHANGEME
--CHANGEME
Content-Disposition: form-data; name="aeneid.txt"; filename="aeneid.txt"
Content-Type: application/octet-stream
FORSAN ET HAEC OLIM MEMINISSE IUVABIT
--CHANGEME--