- 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-08-2020 12:17 AM
Its not possible with single REST Call. Need to make 2 calls one after one. One is to insert record first and then add attachment to it using one more call.
If it has to be done in single call you will have to build custom end point using scripted REST web services.
