- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-07-2020 11:29 PM
How can I create a record from the REST API explorer with an attachment? Please help me understand this part.
Basically I want to create a record and attach the file to that record from REST API explorer or any other API testing tools like POSTMAN
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-08-2020 12:01 AM
Out of the box TABLE API would create record on your target table.
You would require one more API call on Attachment API to add attachment to the above record created
Screenshots below:
1) 1st create record in table using POST call and give the required fields you want
2) Now attach sample file by using that record sys_id which is highlighted in blue
Give table name, file name, record sys id
Request format as text/plain since I have given txt file
Output: File got attached
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-07-2020 11:39 PM
Hi,
I have shared similar thread that might help you.
https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_AttachmentAPI
Mark helpful or correct based on impact.
Regards,
Priyanka A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-07-2020 11:44 PM
From Rest API explorer you need to make two REST API Requests- Please find the below screenshots for your reference
1. Create Record-
Json Body Format-
https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_TableAPI#r_TableAPI-POST
2. Attach the file
Json Body Format-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-07-2020 11:48 PM
Hi,
Check the attachment API:
https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_AttachmentAPI
Also check below threads similar to your thread
If my answer helped you in any way, mark answer as helpful and correct.
Thanks and regards,
Megha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-08-2020 12:01 AM
Out of the box TABLE API would create record on your target table.
You would require one more API call on Attachment API to add attachment to the above record created
Screenshots below:
1) 1st create record in table using POST call and give the required fields you want
2) Now attach sample file by using that record sys_id which is highlighted in blue
Give table name, file name, record sys id
Request format as text/plain since I have given txt file
Output: File got attached
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
