Retrieve attachments and attachment metadata
-
- UpdatedAug 1, 2024
- 3 minutes to read
- Xanadu
- Developer guides
The NowAttachmentService API enables you to perform CRUD operations on attachments and retrieve attachment metadata from your ServiceNow instance.
- Upload attachments to your ServiceNow instance and associated them to a specific record.
- Download one or more attachments.
- Delete attachments.
- Validate an attachment by comparing the computed hash of the attachment to the expected hash.
- Download attachment metadata. This metadata is generated by your ServiceNow instance when an attachment is uploaded.
For additional information on working with attachments, see Attachment API.
The following shows how to obtain a Call object that fetches metadata for a particular attachments. It creates an
executable object that is able to perform the specified request and return
Response<NowAttachmentMetadata>
.
The following shows how to obtain a Call object that fetches metadata for multiple attachments. It creates an
executable object that is able to perform the specified request and return
Response< List<NowAttachmentMetadata>>
.
Attachment metadata pagination
You can use the NowAttachmentService methods to download attachment metadata for one or more attachments. When downloading metadata from multiple attachments, you may want to use the NowAttachmentService - attachmentMetadataPaginator(filter: Filter? = null, limit: Int? = null) method, which returns a Paginator object that enables you to easily iterate over the potentially large amount of data that is returned.
- first()
- hasNext()
- hasPrevious
- isBusy
- last()
- next()
- observe()
- previous()
- reset()