Skip to content
English
  • There are no suggestions because the search field is empty.

How to Export Content via REST Web Services

This article describes how to export Pages and Media from Documoto using REST Web Services. It covers available export options, common use cases and detailed API workflows. 

Article Topics

Page Export Options

  • Documoto's REST Web Services allow users with the Exporter User Group permission to export Pages in a zipped format through asynchronous requests. 
  • Users also have the option to leverage optional request body parameters to export only the Page XML or Page SVG

Use Cases for Exporting Pages

Page exporting may be beneficial for a number of tasks in a user's workflow including, but not limited to:

  • Retrieval of Page-level data to confirm or update version or revision levels
  • Retrieval of Page-level data to update BOM parts, details, order, etc. 
  • Retrieval of Page-level data to update hotpointing, illustrations, attachments, etc.
  • Retrieval of Page-level data for syncing to an external system of record or portal

How to Export a Page via the Page Export APIs

The Page Export workflow follows a 3-step asynchronous process

  1. Start an Asynchronous export with the ExportPage API /page/export-async/v1.
    • This endpoint will respond with a RequestId (also referred to as JobId) for use in polling and downloading the export job. 
    • Pages can be identified by pagefile name and optional pageName and 4-digit locale code (ex. en_US) or by including a specific hashKey.
      • If more than one matching page is found in Documoto, a list of pages and their hashKeys will be returned to aid in selecting the correct page. This will require resubmitting the initial request with the desired hashKey; including the hashKey will cause the system to ignore any other identification details.
    • Note: this API includes optional parameters to export only the Page XML file or only the Page SVG file. Simply include "xmlOnly": true or "svgOnly": true in the request body to leverage these options.
  2. Optional: Submit a polling request to check the status, or error message if applicable, of the export job. (/page/export-async-poll/v1/{requestId}
    • Response options include COMPLETED, IN_PROGRESS, or any applicable exporting job error messages.
  3. Once the export job is complete, to begin downloading the exported page submit a request to the ExportPageResult API (/page/export-async-result/v1/{requestId}) by passing in the RequestId returned in the initial request. This will return a data handler containing a Base64 encoded copy of the requested file. 

Media Export Options

Documoto's REST Web Services allow users with the Exporter permission to export Media to a compressed format via a series of asynchronous requests. There are two versions of the ExportMedia API which allow for exporting to a standard MDZ format (v1), or optional LinkOne and/or SmartEquip format (v1/v2) - if your Tenant is configured to export such formats. Version 2 of the ExportMedia API also includes an optional parameter to export only the Media XML file, rather than the entirety of the Media and its contents. 

  • Export Media API Version 1 (v1): /media/export-async/v1/{identifier}
  • Export Media API Version 2 (v2): /media/export-async/v2?{identifier}

Use Cases for Exporting Media

Exporting a Media via the REST Web Services may be beneficial for a number of tasks in a user's workflow including, but not limited to:

  • Retrieval of Media-level data to confirm or update version or revision levels
  • Retrieval of Media-level data to update media structure
  • Retrieval of Media-level data to update/modify/replace pages and data therein
  • Retrieval of Media-level Table of Contents data to update structure, contents, attachments, etc. (v2)
  • Retrieval of Media-level data in SmartEquip or LinkOne format(s) asynchronously, rather than using the Export module within Documoto

How to Export a Media via the Export Media APIs

Leveraging the ExportMedia API is a multistep, asynchronous process.

The steps to export a Media using the v1 API are as follows:

  1. Start an Asynchronous Export with the ExportMediaV1 API (media/export-async/v1/:identifier) by passing the Media Identifier of the desired media in a query parameter. This will return a Job ID to use in polling for completion.
    • To leverage our new optional parameters for 
  2. Optional: use the returned Job ID with the ExportAsyncPoll API (/media/export-async-poll/v1/:requestId) to poll for the job status.
    • Response options include COMPLETED, IN_PROGRESS, or any applicable exporting job error messages.
  3. Once the export job has been completed, use the ExportAsyncResults API (/media/export-async-result/v1/:requestId) by passing in the completed Job ID. This will return the exported media in a data handler containing a Base64 encoded copy of the media file(s).

The steps to export a Media using the v2 API are as follows:

  1. Start an Asynchronous Export with the ExportMediaV2 API (media/export-async/v2) by passing the Media Identifier as a query parameter. This will return a JobId to be used in polling and downloading of the export job. 
    • This API allows for and optional query parameter to export in LinkOne format or SmartEquip format (&outputType=DOCUMOTO_ARCHIVE/LINKONE/SMARTEQUIP, default = DOCUMOTO_ARCHIVE)
    • This endpoint also allows for exporting only the Media XML file, commonly referred to as the TOC (Table of contents) with the optional parameter &xmlOnly=true/false
  2. Optional: submit a request to the ExportMedia polling API (/media/export-async-poll/v1/{requestId}) by passing in the JobId returned in step 1. 
    • Response options include COMPLETED, IN_PROGRESS, or any applicable exporting job error messages.
  3. Once the export job is complete, to begin downloading the exported Media, submit a request to the ExportMediaResults API (/media/export-async-results/v1/{requestId}) by passing in the JobId returned in step 1. This will return the exported media in a data handler containing a Base64 encoded copy of the media file(s).

How to Fetch and Export Media by Updated Date

By leveraging the Fetch Media API in conjunction with the Export APIs, the Documoto Web Services allow users to retrieve Media Identifiers according to Updated Date to be exported and uploaded to external systems for content syncing workflows.

The steps to retrieve Media Identifiers by Updated Date are as follows:

  1. Submit a POST request to the /media/identifier/v1 endpoint, including the following data:
    1. Start - Starting indexing for returned values (Default: 0)
    2. Limit - The number of items to be returned (Default: 100)
    3. LanguageCode4s - 2 or 4-digit Language Code (ex: "en")
    4. Filter(s) - Filter criteria for Identifiers to be returned
      1. Name - The updated field to check (Either "updated" or "contentUpdated")
      2. DateValue - The datetime to compare against, formatted as "yyyy-MM-dd'T'HH:mm:ss'Z'" (ex. 2022-03-09T21:04:34Z)
      3. Operator - The logical comparison operator to be used, either "lessThanEqual", "greaterThanEqual", or "equal"
    5. The endpoint will respond with a list of Media Identifiers that match the provided filters, or any relevant errors that may have occurred.
    6. With the provided list of Identifiers, leverage either the ExportMediaV1 or ExportMediaV2 APIs as described above to export the content into either Documoto Archive (MDZ), SmartEquip, or LinkOne formats as needed by the external system.