Can we have a generic content type for the all types of files for sending attachments from postman ?

Thej1
Tera Expert

Hi,

 

To send the attachments from postman by using scripted web services, sending the request body in json format as below.

{
  "incidentNumber""INC0010002",
  "fileName""Testtt.png",
    "contentType""image/png",
  "fileData": "Base64 code"
}
Can we have one generic content type for the different types of files(.png, .jpeg, .pdf, .doc, .docx ..etc) ?
 
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Thej1 

each file has it's own unique content type with which it's identified in base64 encoded string as well

So you cannot send application/pdf for docx file and vice versa

So if 3rd party is sending file data then they should at least give contentType and base64 data for that file without which the file will be corrupted when attached in sys_attachment table

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Thej1 

each file has it's own unique content type with which it's identified in base64 encoded string as well

So you cannot send application/pdf for docx file and vice versa

So if 3rd party is sending file data then they should at least give contentType and base64 data for that file without which the file will be corrupted when attached in sys_attachment table

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Then how can we handle attachments with different content types in integration ?

 

Thanks

@Thej1 

each integration is different and the requirements will vary.

it's not that you can create it for 1 and use for others.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Thej1 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader