Is there any way we can send a large file to 3rd party system using REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:02 AM
Hello Experts,
I am trying to send a large file attached to a record via REST API to 3rd party system, and contents are XML, i have already converted file to base64 and also I am able to send file size upto 10MB but i need to send a attachment which is having a size of 30MB minimum it could be more than that according to customer data file size can increase
Do anyone have any idea how can we achieve this in servicenow?
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:05 AM
Hi,
RESTMessageV2 has a method called setRequestBodyFromAttachment(attachmentSysId). Use this instead of setRequestBody. You can remove all of the code that calls GlideSysAttachment and just pass the Sys ID of the attachment to this method.
https://developer.servicenow.com/app.do#!/rest_api_doc?v=london&id=r_AttachmentAPI-POST
If my answer is helpful mark correct and helpful.
Regards,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:16 AM
Hi,
I think Service now did now allow more then 10 MB data to sent via attachment to third party. You can follow below step to achieve your objective.
1) Fill 1 record with maximum value in all fields.
2) Then copy paste above record and check size at how may list of records it becomes 8 MB.
3) Mark that number of record like:- 978
4) create one customized field for bifurcation
5) suppose you have 3000 records , send it in 4 rest calls instead of one
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:20 AM
@nitis,
Completely agree with you, but sending data in chunks won't work because the 3rd party system will not understand data chunks. They only understand one single file (Base64 Encoded).
Also i found that this issue is very frequently asked and till date. but no such concert solution for this.
Regards,
Amol Bavaskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 05:16 AM
Hey @Pratiksha Kalamkar,
Thank you for quick response. but i need to send files as well as some data in the request. can we send both together?
is there any way we can add both data and files too?
Regards,
Amol Bavaskar