How to pass attachment when submitting a catalog item form web page using REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 08:31 AM
I am using scripted REST API to create RITM.
This is the JSON object to pass the variables to create a catalog item.
{
'sysparm_quantity': 1,
'variables': {
'title' : 'test titile',
'phone_number' : '99044444a2',
'type' : 'new',
'approvaluser' : '7a8929983b9c445052ca655593efc440',
'request_for' : '7a8929983b9c445052ca655593efc440',
'email':'x',
'website' : 'https://www.google.com/'
}
}
BUT HOW DO I PASS ATTACHMENT WHEN A REQUEST IS SUBMITTED FROM A WEB PAGE.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 09:16 AM
Once you make the call to order/create the request you should have the sys_id of the request so you will then have to use the attachment API to add the attachment.
https://developer.servicenow.com/dev.do#!/reference/api/tokyo/rest/c_AttachmentAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 09:42 AM
Hi @DrewW ,
"Once you make the call to order/create the request you should have the sys_id of the request so you will then have to use the attachment API to add the attachment." ---> I have done this. I am able to create RITM and alll. But how do I receive the attachment and how to do I put it into the newly created RITM.