Mapping Microsoft SharePoint Content Types
On This Page
Overview
SharePoint content types are a type of custom metadata that allow you to categorize files. DryvIQ supports mapping content types between the source and destination. Currently, content type mapping is only available through the DryvIQ REST API.
Retrieving Content Type
You can send a GET message through the REST API to retrieve the metadata schema for a SharePoint/Office 365/OneDrive for Business connection. You can retrieve the metadata schema for a file or folder based on the path for the file or folder or the ID for the file or folder. The examples below provide sample code.
GET by File Path
GET {{url}}v1/connections/{connectionID}/files/metadata_schema?path=FilePath
GET by File ID
GET {{url}}v1/connections/{connectionID}/files/{fileID}/metadata_schema
GET by Folder Path
GET {{url}}v1/connections/{connectionID}/folders/metadata_schema?path=FolderPath
GET by Folder ID
The call will return return the metadata schema that includes a field called ContentTypeId. This field will list all possible choices for the content type caption (name) and value pairs. You can use these values to set the ContentTypeId field for a file or folder in the metadata mapping.
Adding Content Types to the Metadata When Creating a Job
To set up content type metadata mapping when creating a job, you must create a choice map that maps the source values to destination the values using the information provided by the GET metadata_schema endpoint. This information is added to the metadat_map in the transfer block.
Make sure you only use each content type ID once. Listing the same content type ID twice will cause a duplicate database key error. This can happen if you duplicate a job with an existing content type map and then use the Advanced Scripting page in the UI to add JSON to map the content types again.