npm SDK API Reference
getTemplateUrl(options)
Retrieves the template associated with a document and returns a presigned URL that can be used directly to fetch the file. The presigned URL expires after 1 hour.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetTemplateUrlResponse>
getDocumentSources(options)
Lists all sources associated with a given section within a document. Used to populate the Sources panel when a user selects or highlights a section of the draft.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
sectionId | string | Yes | The section ID to retrieve sources for |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSourcesResponse>
getDocumentSourceUrl(options)
Fetches the presigned URL for a given source reference, enabling preview of the original source material from within the Sources panel.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentSourceId | string | Yes | Source ID obtained from getDocumentSources |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSourceUrlResponse>
getSectionFromText(options)
Given a user-defined text selection within the draft editor, identifies the enclosing section and returns its metadata. Use the returned sectionId with getDocumentSources to retrieve sources for that section.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The document ID |
highlightedText | string | Yes | The raw text string of the user’s selection |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetSectionFromTextResponse>
getDocumentSections(options)
Retrieves all sections for a given document, returning each section’s ID, title, and display order. Useful for building navigation, table of contents, or populating section selectors.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | The unique identifier of the document |
accessToken | string | Yes | Your organization access token |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GetDocumentSectionsResponse>
generateProxyUrl(options)
Fetches a file by streaming it through the backend’s proxy endpoint. Takes a presigned S3 URL and streams the file content back, returning it as a Blob. Useful for displaying source documents in the browser without exposing S3 URLs directly.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
presignedUrl | string | Yes | A presigned S3 URL to stream through the proxy |
baseUrl | string | Yes | The Artos API base URL |
apiClient | ApiClient | No | Pre-configured API client (advanced usage) |
Promise<GenerateProxyUrlResponse>