The CreatorCon Call for Content is officially open! Get started here.

How to add an attachment to a cart item using scripted REST API

mkirby528
Mega Contributor

I have created a REST API to add items and to cart and configure variables using the Cart API. I am wondering if it is possible to attach an attachment to an item via this API. On the service catalog, I have added a variable that uses a UI page to add an attachment to the item, but I am wondering if it is possible to add an attachment to an item using an API. Thanks!

1 ACCEPTED SOLUTION

mkirby528
Mega Contributor

I seem to have figured it out. While I wasn't able to directly add the attachment in my scripted API, I was able to return the RITM sys_id and use the Attachment REST api to post the attachment to that item in the sn_req_item table.

View solution in original post

5 REPLIES 5

Raf1
Tera Guru

mkirby528
Mega Contributor

Thanks for pointing me in the right direction. I see that in that example, they are using the incident table. Do you know what table I should use to have my attachment be attached to my requested service catalog item?

To add onto this, I'm hoping to add the attachment in my Scripted API, while I'm filling in the other variables for the catalog item. Is this something that can be done?

mkirby528
Mega Contributor

I seem to have figured it out. While I wasn't able to directly add the attachment in my scripted API, I was able to return the RITM sys_id and use the Attachment REST api to post the attachment to that item in the sn_req_item table.