Accepting Inbound Attachements via REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 01:05 PM
Hey all,
I am looking to create a Scripted REST API that will accept inbound attachments. I have designed an endpoint that accepts payload data and creates a support case. I would also like to allow attachments via the same endpoint, is this possible? I am looking at the attachment API but I don't see a way to target the inbound attachment file. Thanks in advance for the help!
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 01:36 PM
Can your external API send the file via base64 string in the JSON? You could use the writeBase64 method to create an attachment via a Script REST API:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 01:49 PM
This seems close to what I am trying to accomplish. Any idea how I can get the attachment? For example, do I need to assign the attachment like I would when trying to get the JSON payload (ex: response.body.data)? I am most confused how to target the inbound file. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 01:37 PM
The two OOB attachment api's should be sufficient, for both you specify the sys_id and table name. Is your custom SRAPI returning these values to which the sender could use to make a secondary call to send the attachments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 01:52 PM
I am looking for an external system to send me a payload and attachment file, for which I will then save the attachment and create a case with with payload data. I would rather not allow outside sources to be able to directly query the attachments table, but add a safe guard of the API endpoint in between. Do you know if there is an OOB feature that covers that? Thanks!
