03-27-2022 10:35 PM
Hello,
I am trying to access the attachment and the data present in the attachment file (.csv). I used the rest snap to access the service now API endpoint. I was able to navigate to all the fields except the attachment.
Thanks,
Harshavardhana
03-28-2022 12:02 AM
Hi @Harsha3,
If you want to access the binary file, there is a specific endpoint to do that:
https://instance.servicenow.com/api/now/attachment/{sys_id}/file
For more informations and guidelines head over to:
Attachment API | ServiceNow
Once you got the response you need to map it and change the output view on the Mapper Snap to binary, the mapping is shown below:
And then you can use the CSV Parser Snap to parse the content.
Let me know if this helps you,
BR Aleksandar.
04-27-2022 11:05 PM
Thanks for the reply, however, there is a 502 error when I am trying to invoke a REST API call. I got the sysid of the task but unfortunately, I could not proceed further.
Thanks,
Harshavardhana
05-17-2022 10:11 PM
Hello Harsha,
In the Rest Get Snap use the Response Entity Type as Binary and that should let you download the file.
Thanks
06-03-2022 07:38 AM
Thanks @Karuna_M I was able to get the attachment response, can you please guide me on how to get the actual contents in the file.?This is the mapper response that I obtained after the REST GET response when invoking the attachment API of the service NOW.
Thanks,
Harshavardhana