Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • API, CLI, and SDK Documentation
  • REST API Documentation
  • Jobs Using REST API
  • Metadata Mapping (REST API)

Mapping Microsoft SharePoint Content Types Using REST API

Learn how to map SharePoint content types for migration jobs using the DryvIQ REST API.

Written by Andrea Harvey

Updated at May 2nd, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Insights
    Prebuilt Insights Custom Insights
  • Content
  • Accounts
  • Activity Log
  • Content Scans
  • Migrations
    Migration Jobs Migration Reports Maps Flagged Items Migration Tools
  • Connections
    Supported Platform Connections Creating Connections Connection Maintenance Connection Pools
  • Entity Types
    DryvIQ Available Entity Types Custom Entity Types Entity Type Maintenance
  • Action Sets
    Creating Action Sets Action Sets Maintenance
  • Settings
    License Performance Notifications Extensions Entity Types Settings Display Settings Configuration
  • API, CLI, and SDK Documentation
    REST API Documentation Command-line Interface SDK Development
  • POC Offering
  • Release Notes
+ More

Table of Contents

Overview Retrieving Content Type GET by File Path GET by File ID GET by Folder Path GET by Folder ID Adding Content Types to the Metadata When Creating a Job

Overview

SharePoint content types are a type of custom metadata that allows 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 request through the REST API to retrieve the metadata schema for a Microsoft SharePoint, Office 365, or OneDrive for Business connection. You can retrieve the metadata schema for a file or folder based on its path, ID, or both. 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

GET  {{url}}v1/connections/{connectionID}/folders/{folderID}/metadata_schema

The request will return the metadata schema, which 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.

},
               "ContentTypeId": {
                   "choices": [
                       {
                           "value": "Document_ID",
                           "caption": "Document"
                       },
                       {
                           "value": "Folder_ID",
                           "caption": "Folder"

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 metadata_map in the transfer block.

{
   "transfer": {
           "metadata_map": {
               "schemas": [{
                       "mappings": [{
                               "source": {
                                   "property": {
                                       "name": "ContentTypeId"
                                   }
                               },
                               "destination": {
                                   "property": {
                                       "name": "ContentTypeId"
                                   }
                               },
                               "choices": [{
                                       "source": {
                                           "value": "0x010109008A55C32FB5DB9D4496723A82067F6F4D"
                                       },
                                       "destination": {
                                           "value": "0x010100C2138012BBD4B4439BD03ABF3FF6BCC7008AA8EF10A21C2042AC4CEC551BCA11F0"
                                       }
                               }
                           ]
                       }
                   ]
               }
           ]
       }
   }
}

Use each content type ID only 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. 

 

 

rest api api job microsoft content types metadata mapping

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Google Drive
  • Microsoft SharePoint On-premises (REST API)
  • Microsoft Teams (REST API)

Copyright 2025 – DryvIQ, Inc.

Knowledge Base Software powered by Helpjuice

Expand