API For sending attachment

Vamshi_ch123
Tera Contributor

Hi,

 

I've shared the scripted REST API with the customer to create a ticket in our ServiceNow instance. Now, they're also inquiring about uploading attachments. Do we need to provide a separate API for updating attachments, or can this be done using the same API? if yes how can we validate the file size in the script

 

Thanks

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Vamshi_ch123 

use the same scripted rest api and ask them to send these information

1) base64encoded data

2) file name

3) content type

check this link where something similar I answered in past

Scripted Rest API to update incident with attachment 

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 , here why we use base64encoded data

@Vamshi_ch123 

because we usually send and receive attachment using base64encoded data with 3rd party app

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

@Vamshi_ch123 

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