Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ritz05
Contributor
Contributor

Error : To upload document on ServiceNow using REST Client

Hi Team,

I am trying to upload a document (.Doc,.Docx,pdg,msg) on servicenow URL using REST client component with POST method in Talend (version: 7.3.1) .

with below setting few documents are successfully getting uploaded on servicenow URL using below setting in REST component.

tREST :

URL : Servicenow URL "/api/now/attachment/file?table_name="+context.TableName+"&table_sys_id="+((String)globalMap.get("TABLE_SYS_ID"))+"&file_name="+((String)globalMap.get("UploadFileName"))+""

HTTP Method: POST

HTTP Headers :

name: "Authorization" context.connection_ServiceNow_Basic_Authorization

"Accept" "application/json"

"Content-type" "application/"+((String)globalMap.get("FILE_TYPE"))

HTTP Body : (byte[])globalMap.get("BINARY_FILE_CONTENT")

But few documents giving below error.

Error Code :400

Error Message : {"error":{"message":"Invalid file type: application/doc","detail":null},"status":"failure"}

Please help in resolving this issue.

Thanks,

Rita

Labels (3)
1 Reply
gjeremy1617088143

Hi,

Extension MIME Type

.doc application/msword

.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document

 

https://developer.mozilla.org/fr/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types

Send me love and kudos