Bulk Send via API -> Unsupported Media Type
Tuesday, September 1, 2020 at 01:21pmHi Duo, I keep getting Unsupported Media type error below:
{"code":415,"messageKey":"http.status.415","message":"Unsupported Media Type","name":"Unsupported Media Type"}
POST {{TheHost}}/api/packages/CsilES9ZX4XpSucsL-s7t3bFQp8=/bulk_send
Content-Type text/csv
BODY-I've tried to put file path/name a few ways, JSON, with quotes, without quotes
raw Text
{
"FilePath": "C:\Users\mikcanf\Downloads\OneSpan\Commitment letter Data.csv"
}
"C:\Users\mikcanf\Downloads\OneSpan\Commitment letter Data.csv"
C:\Users\mikcanf\Downloads\OneSpan\Commitment letter Data.csv
Reply to: Bulk Send via API -> Unsupported Media Type
Tuesday, September 1, 2020 at 01:35pmHi Mike,
Try to make the request Content-Type as "multipart/form-data", add a form data called "file" with the binary of your CSV file.
Accept could be "text/html" -
A successful response:
<pre>{"id":"d6721790-a0bc-4a54-b24b-25d02e87894d"}</pre>
A failed response:
<pre>[{"messageKey":"error.bulkSend.missingRole","rowNumber":1,"columnName":"BankAccountOwner","roleName":"BankAccountOwner"},{"messageKey":"error.bulkSend.missingRole","rowNumber":1,"columnName":"SalesAgent","roleName":"SalesAgent"},{"messageKey":"error.bulkSend.missingRole","rowNumber":1,"columnName":"Insured","roleName":"Insured"}]</pre>
Duo
Reply to: Bulk Send via API -> Unsupported Media Type
Tuesday, September 1, 2020 at 04:04pmData
Signer1,FIRST_NAME,LAST_NAME,EMAIL,AUTH_TYPE,AUTH_PROMPT,AUTH_CHALLENGE,SEND_DATE,BUSINESS_NAME,BUSINESS_ADDRESS
Signer1,Signer,Testguy1,[email protected],SMS,+1 xx252,,2020-09-01,This is bus name,This is bus address
Signer1,Signer,Testguy2,[email protected],SMS,+1 xx252,,2020-09-01,This is bus name,This is bus address
Signer1,Signer,Testguy3,[email protected],SMS,+1 xx252,,2020-09-01,This is bus name,This is bus address
Error
<pre>[{"messageKey":"error.bulkSend.missingRole","rowNumber":1,
"columnName":"Signer1","roleName":"Signer1"}]</pre>
a) Not sure if row1 is header row or 1st row of data
b) above data seems to process Ok inside Sign itself, just not bulk load ???
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 09:07amHi Mike,
The row1 should refer to the header row. From the error message, it seems OSS system can't recognize the first column header "Signer1", which should match the placeholder with role name of "Signer1".
From the CSV content itself, the headers and the data look fine. So to further investigate, do you mind sharing the template ID and this CSV file (with dummy information) that you are uploading?
Duo
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 09:22amTemplateId#-> CsilES9ZX4XpSucsL-s7t3bFQp8=
Added CEBA commitment letter Data.txt input file.
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 09:23am*Note: Template ID# and uploaded file in previous comment above is from our SANDBOX
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 12:22pmCreated a template with the same layout at my end, but I didn't reproduce the error when uploading the CSV file(.csv or .txt shouldn't be a matter).
Considering everything looks good to me - CSV headers, placeholder name, label field names, could you try below:
(1)resave the txt or csv file in UTF-8 encoding
(2)try to upload the file through UI, instead of API (at Template tab, expand the three dots after the template line, and choose "Bulk Send transactions")
Duo
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 01:27pmHi Duo, I already tried it thru UI and it worked, hence my confusion re API result. I will load/re-run in UI again. Per your comments, your use API call worked?
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 01:35pmYes, see my Postman screenshot:
Duo
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 01:55pmUI works, not API, for some reason. What version of POSTMAN are you using? What version of Sign are you using?
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 02:01pmMy Postman is 7.31.0. I also found that if you choose the form data "file" as text type, and insert the content in plain text, should also work. For OneSpan Sign instance, it's the same CA sandbox as your account.
Duo
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 03:13pmHi Duo, success! after I copied your screen it worked! Thx for all your help!
Reply to: Bulk Send via API -> Unsupported Media Type
Wednesday, September 2, 2020 at 03:21pmGlad it works for you!