This article describes API calls available for Documents configuration:
- 
/api/document: Allows retrieving, creating, updating, and deleting Documents.
- 
/api/document_category: Allows retrieving Documents assigned to Categories, assigning a Document to a Category, and removing a Document from a Category.
- 
/api/document_element: Allows retrieving Documents assigned to Elements, assigning a Document to an Element, and removing a Document from an Element.
- 
/api/document_folder: Allows retrieving Documents assigned to Folders, assigning a Document to a Folder, and removing a Document from a Folder.
- 
/api/document_group: Allows retrieving Documents assigned to Groups, assign a Document to a Group, and removing a Document from a Group.
- 
/api/document_type: Allows retrieving, creating, updating, and deleting Document Types.
Prerequisites:
- Set up API access
- Verify that you have API access and obtain a token via get_token call
Table of contents:
1. Access Admin > System > API Toolkit
2. Configure Documents
2.1. Retrieve Documents
The GET request to /api/document returns all Documents.
- Item: document
- Method: GET
- Optionally, filter the result by:- ID: Enter the Document ID
- element: Enter the element ID
- document_type: Enter the ID of the Document Type
- created_by_user: Enter the ID of the User
- 
is_global_document:- 'Y': Returns all Global Document
- 'N': Returns all Documents that are not global
 
 
- Enter an API Token
- [Run request]
Example Response
 {
  "documents": [
    {
      "id": 1,
      "document_type": 2,
      "name": "Jump Start Guide for Regular Users",
      "created_by_user": 19,
      "revision_date": "2018-11-30 10:59:02",
      "source_type": "External Link",
      "external_url": "http://help.metricinsights.com/m/Jump_Start_Guide_for__Regular_Users",
      "is_global_document": "Yes",
      "share_with_admin": "No",
      "share_with_power": "No",
      "share_with_regular": "No"
    },
    {
      "id": 2,
      "document_type": 2,
      "name": "Jump Start Guide for Administrators",
      "created_by_user": 19,
      "revision_date": "2019-01-28 14:22:49",
      "source_type": "External Link",
      "external_url": "http://help.metricinsights.com/m/Jump_Start_Guide_for_Administrators",
      "is_global_document": "Yes",
      "share_with_admin": "No",
      "share_with_power": "No",
      "share_with_regular": "No"
     }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the Document | 
| document_type | integer | The ID of the Document Type | 
| name | string | The Document name | 
| created_by_user | integer | The ID of the User who created the Document | 
| revision_date | string | The Revision Date of the Document | 
| source_type | string | The Document's Source type. Supported values: "External Link", "PDF File". | 
| external_url | string | The Document's External URL | 
| is_global_document | string | Whether or not the Document is global. Supported values: "Y", "N". | 
| share_with_admin | string | Whether or not the Document is shared with Admins. Supported values: "Yes", "No". | 
| share_with_power | string | Whether or not the Document is shared with Power Users. Supported values: "Yes", "No". | 
| share_with_regular | string | Whether or not the Document is shared with Regular Users. Supported values: "Yes", "No". | 
2.2. Create Document
The POST request to /api/document creates a new Document.
- Item: document
- Method: POST
- 
ID: Enter the ID of an existing Document- See Retrieve Documents for details
 
- Select JSON request and modify the request body by providing the following values:- document_type: The ID of the Document Type
- name: The name of the Document
- 
share_with_admin: Whether or not the Document is shared with Admins- Supported values: "Yes", "No"
 
- 
share_with_power: Whether or not the Document is shared with Power Users- Supported values: "Yes", "No"
 
- 
share_with_regular: Whether or not the Document is shared with Regular Users- Supported values: "Yes", "No"
 
- revision_date: The Revision Date of the Document
- 
is_global_document: Whether or not the Document is global- Supported values: "Y", "N"
 
- 
source_type: The Document's Source type. - Supported values: "External Link", "PDF File"
 
- 
external_url: The Document's External URL- Leave this field empty if the source_type is set to "PDF File"
 
 
- Enter an API Token
- [Run request]
2.3. Update Document
The PUT request to /api/document/id/<ID> updates the selected Document.
- Item: document
- Method: PUT
- Enter the ID of the Document that needs to be updated- See Retrieve Documents for details
 
- Select JSON request and provide values for the following parameters:- id: The ID of the Document
- document_type: The ID of the Document Type
- name: The name of the Document
- 
share_with_admin: Whether or not the Document is shared with Admins- Supported values: "Yes", "No"
 
- 
share_with_power: Whether or not the Document is shared with Power Users- Supported values: "Yes", "No"
 
- 
share_with_regular: Whether or not the Document is shared with Regular Users- Supported values: "Yes", "No"
 
- revision_date: The Revision Date of the Document
- 
is_global_document: Whether or not the Document is global- Supported values: "Y", "N"
 
- 
source_type: The Document's Source type. - Supported values: "External Link", "PDF File"
 
- 
external_url: The Document's External URL- Leave this field empty if the source_type is set to "PDF File"
 
- created_by_user: The ID of the User who created the Document
 
- Enter an API Token
- [Run request]
2.4. Delete Document
The DELETE request to /api/document/id/<ID> deletes the Document.
- Item: document
- Method: DELETE
- ID: Enter the ID of the Document that needs to be deleted
- Enter an API Token
- [Run request]
3. Configure Document Categories
3.1. Retrieve Document Categories
The GET request to /api/document_category returns all Categories that the Documents are assigned to.
- Item: document_category
- Method: GET
- Optionally, filter the result by:- 
ID: The ID of the document_categorydata entry
- document: Enter the ID of the Document
 
- 
ID: The ID of the 
- Enter an API Token
- [Run request]
Example Response
{
  "document_categories": [
    {
      "id": 1,
      "document": 4,
      "category": 187
    },
    {
      "id": 2,
      "document": 21,
      "category": 213
    },
    {
      "id": 3,
      "document": 24,
      "category": 123
    }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the document_categorydata entry | 
| document | integer | The ID of the Document | 
| category | integer | The ID of the Category | 
3.2. Assign Document to Category
The POST request to /api/document_category assigns Document to a Category.
- Item: document
- Method: POST
- 
ID: Enter the ID of an existing document_categorydata entry- See Retrieve Document Categories for details
 
- Select JSON request and modify the request body by providing the following values:- document: The ID of the Document
- category: The ID of the Category
 
- Enter an API Token
- [Run request]
3.3. Remove Document From Category
The DELETE request to /api/document_category/id/<ID> removes Category from the Document.
- Item: document_category
- Method: DELETE
- 
ID: Enter the ID of the document_categorydata entry that needs to be deleted
- Enter an API Token
- [Run request]
4. Configure Document Elements
4.1. Retrieve Document Elements
The GET request to /api/document_element returns all Elements that the Documents are assigned to.
- Item: document_element
- Method: GET
- Optionally, filter the result by:- 
ID: The ID of the document_elementdata entry
- document: Enter the ID of the Document
 
- 
ID: The ID of the 
- Enter an API Token
- [Run request]
Example Response
{
  "document_elements": [
    {
      "id": 1,
      "document": 1,
      "element": 1439
    },
    {
      "id": 7,
      "document": 8,
      "element": 1523
    }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the document_elementdata entry | 
| document | integer | The ID of the Document | 
| element | integer | The ID of the Element | 
4.2. Assign Document to Element
The POST request to /api/document_element assigns Document to an Element.
- Item: document_element
- Method: POST
- 
ID: Enter the ID of an existing document_elementdata entry- See Retrieve Document Elements for details
 
- Select JSON request and modify the request body by providing the following values:- document: The ID of the Document
- element: The ID of the Element
 
- Enter an API Token
- [Run request]
4.3. Remove Document From Element
The DELETE request to /api/document_element/id/<ID> removes Document from the selected Element.
- Item: document_element
- Method: DELETE
- 
ID: Enter the ID of the document_elementdata entry that needs to be deleted
- Enter an API Token
- [Run request]
5. Configure Document Folders
5.1. Retrieve Document Folders
The GET request to /api/document_folder returns all Folders that the Documents are assigned to.
- Item: document_folder
- Method: GET
- Optionally, filter the result by:- 
ID: The ID of the document_folderdata entry
- document: Enter the ID of the Document
 
- 
ID: The ID of the 
- Enter an API Token
- [Run request]
Example Response
{
  "document_folders": [
    {
      "id": 1,
      "document": 21,
      "folder": 209
    },
    {
      "id": 2,
      "document": 25,
      "folder": 279
    }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the document_folderdata entry | 
| document | integer | The ID of the Document | 
| folder | integer | The ID of the Folder | 
5.2. Assign Document to Folder
The POST request to /api/document_folder assigns Document to the selected Folder.
- Item: document_folder
- Method: POST
- 
ID: Enter the ID of an existing document_folderdata entry- See Retrieve Document Folders for details
 
- Select JSON request and modify the request body by providing the following values:- document: The ID of the Document
- folder: The ID of the Folder
 
- Enter an API Token
- [Run request]
5.3. Remove Document From Folder
The DELETE request to /api/document_folder/id/<ID> removes Document from the selected Folder.
- Item: document_folder
- Method: DELETE
- 
ID: Enter the ID of the document_folderdata entry that needs to be deleted
- Enter an API Token
- [Run request]
6. Configure Document Groups
6.1. Retrieve Document Groups
The GET request to /api/document_group returns all Groups that the Documents are assigned to.
- Item: document_group
- Method: GET
- Optionally, filter the result by:- 
ID: The ID of the document_groupdata entry
- document: Enter the ID of the Document
 
- 
ID: The ID of the 
- Enter an API Token
- [Run request]
Example Response
{
  "document_groups": [
    {
      "id": 1,
      "document": 13,
      "group": 17
    },
    {
      "id": 5,
      "document": 25,
      "group": 63
    }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the document_groupdata entry | 
| document | integer | The ID of the Document | 
| group | integer | The ID of the Group | 
6.2. Assign Document to Group
The POST request to /api/document_group assigns Document to the selected Group.
- Item: document_group
- Method: POST
- 
ID: Enter the ID of an existing document_groupdata entry- See Retrieve Document Groups for details
 
- Select JSON request and modify the request body by providing the following values:- document: The ID of the Document
- group: The ID of the Group
 
- Enter an API Token
- [Run request]
6.3. Remove Document From Group
The DELETE request to /api/document_group/id/<ID> removes Document from the selected Group.
- Item: document_group
- Method: DELETE
- 
ID: Enter the ID of the document_groupdata entry that needs to be deleted
- Enter an API Token
- [Run request]
7. Configure Document Types
7.1. Retrieve Document Types
The GET request to /api/document_type returns all Document Types.
- Item: document_type
- Method: GET
- Enter an API Token
- [Run request]
Example Response
{
  "document_types": [
    {
      "id": 4,
      "name": "Case Study & White Paper"
    },
    {
      "id": 3,
      "name": "Video"
    },
    {
      "id": 1,
      "name": "Release Note"
    },
    {
      "id": 2,
      "name": "User Guide"
    }
  ]
}Fields Description
| Parameter Name | Value Type | Description | 
|---|---|---|
| id | integer | The ID of the Document Type | 
| name | string | The name of the Document Type | 
7.2. Create Document Type
The POST request to /api/document_type creates a new Document Type.
- Item: document_type
- Method: POST
- 
ID: Enter the ID of an existing Document Type- See Retrieve Document Types for details
 
- Select JSON request and modify the request body by providing the following values:- name: The name of the Document Type
 
- Enter an API Token
- [Run request]
7.3. Update Document Type
The PUT request to /api/document_type/id/<ID> updates the selected Document Type.
- Item: document_type
- Method: PUT
- Enter the ID of the Document Type that needs to be updated- See Retrieve Document Types for details
 
- Select JSON request and provide values for the following parameters:- id: The ID of the Document Type
- name: The new name of the Document Type
 
- Enter an API Token
- [Run request]
7.4. Delete Document Type
The DELETE request to /api/document_type/id/<ID> deletes the Document Type.
- Item: document_type
- Method: DELETE
- ID: Enter the ID of the Document Type that needs to be deleted
- Enter an API Token
- [Run request]
 
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      