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:52 PM
Hi,
To clarify the process;
An attachment is not posted to the REST API end point that was used to insert/update your record, but is posted directly to the target record (case) with one of the dedicated attachment API’s,
So you need to Post your new case via the scripted REST API endpoint,
then using the data returned in the response from the task post IE sys_id and table (if table not known) you POST the attachment directly to the target record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 02:02 PM
This helps a bit, thanks.
To make sure I understand, if my REST API first creates the case, then pulls the table and sys_id of the case, I could make a secondary call to the attachment API to add the attachment that way? How would I be able to "copy" the inbound attachment file to be sent to the Attachment API? Sorry if this is confusing (probably because I am a little confused still, ha!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 02:39 PM
I believe it would help if you clarified the nature of the system doing the REST API calls that are to create a Case and attachments for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 02:17 PM
Hi, your solution will depend on how your source platform is posting the new record and attachment. Posting to the target table will depend on you returning the target details to your source platform and this would need to be thought through carefully.
One other option that may simplify your process could be to post the attachment to your 'new' record that's created in your API endpoint table, and then as part of the subsequent transform update the attachments record to point at the target table and record.
