--- title: Retrieve attachments and attachment metadata description: The NowAttachmentService API enables you to perform CRUD operations on attachments and retrieve attachment metadata from your ServiceNow instance. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/developer-guides/mobsdk-ios-retrieve\_attach\_metadata.html release: australia product: Developer Guides classification: developer-guides topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 3 breadcrumb: [Mobile SDK Developer Guide - iOS, Developer guides, API implementation and reference] --- # Retrieve attachments and attachment metadata The NowAttachmentService API enables you to perform CRUD operations on attachments and retrieve attachment metadata from your ServiceNow instance. Using this API you can: - 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/c_AttachmentAPI.md). All `[NowAttachmentService](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowAttachmentServiceiOSAPI.md)` methods provide three implementations for returning results data. One that calls a completion handler with the return results, one that preforms an async/await, and another that returns a [Combine](https://developer.apple.com/documentation/combine) publisher \(deprecated\). For example, each upload\(\) method uploads and associates a specified attachment to a specified record. However, the `[NowAttachmentService - upload\(data: Data, configuration: NowAttachmentUploadConfiguration, progressUpdate: @escaping ProgressUpdate, completion: @escaping \(Result<NowAttachmentMetadata, NowDataError>\)\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowAttachmentServiceiOSAPI.md)` method calls a completion handler with the return results, the [NowAttachmentService - upload\(data: Data, configuration: NowAttachmentUploadConfiguration, progressUpdate: @escaping ProgressUpdate\) async throws](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowAttachmentServiceiOSAPI.md) method performs an async/await, and the `[NowAttachmentService - upload\(data: Data, configuration: NowAttachmentUploadConfiguration, progressUpdate: @escaping ProgressUpdate\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowAttachmentServiceiOSAPI.md)` method returns a Combine publisher. Before you are able to use the NowAttachmentService API, you must import NowData and then initialize a NowAttachmentService object. ``` // Import the NowData framework import NowData func makeAttachmentService(instanceUrl: URL, completion: @escaping ((Result) → Void)) ``` ## 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, limit: Int\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/NowAttachmentServiceiOSAPI.md)` method, which returns a [Paginator](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/PaginatorIOSAPI.md) object that enables you to easily iterate over the potentially large amount of data that is returned. You typically use paginated return results to provide infinite scroll capabilities for data presented inside a UITableView, a UICollectionView \(UIKit\), or a List \(SwiftUI\), or to simplify page iteration of results in general. After obtaining a Paginator object, subscribe to its publisher to start receiving data. ``` paginator.publisher .subscribe(on: DispatchQueue.global()) .receive(on: DispatchQueue.main) .sink { ... } .store(in: &subscriptions) ``` The returned Paginator object provides the following methods that enable you to page through the returned records: - first\(\) - last\(\) - next\(\) - previous\(\) - reset\(\) **Note:** Some Paginator methods may throw an exception, such as when there are no more pages to fetch. In addition, the Paginator object provides properties that enable you to obtain insights into the paginated data. For additional details on these properties and the available methods, see `[Paginator API - iOS](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/cllent-mobile-api-reference/PaginatorIOSAPI.md)`.