Add Document Metadata

 

Add the metadata for a specified document with this method.

 

HTTP Verb/Method:

POST 

URL Format:

http://server/api/documents/{OrderID}/{DocName}

Returns:

HTTP status of 200 (OK) is returned upon a successful add or update.

 

The following table lists the parameters available for this method request.

 

Parameter

Description

OrderID

Enter the primary key of the requested MoversSuite order.

DocName

Enter the name of the document to be added or updated.

 

 

Property Descriptions

 

The following JSON example shows all possible property settings available. Not all properties will be set when adding or updating metadata (see the individual property descriptions for more information).

 

Bill of Lading Example:

 

{

    "ContentUri": "file:\/\/host\/folder\/bol-andrews.tiff",

    "InternalContentID": 23456,

    "Description": "Bill of Lading - Andrews",

    "Notes": "This is the BOL for Shipper named Andrews",

    "Type": "SBOL",

    "SysUserID": 1,

    "ExternalSystem": "Suddath Document System"

}

 

Work Ticket Example:

 

{

    "ContentUri": "file:\/\/host\/folder\/workticket_12345-15.tiff",

    "InternalContentID": 932039,

    "Description": "Work Ticket",

    "Notes": "Work Ticket for Order #12345-15",

    "Type": "WORK",

    "WorkTicketNumber": "5",

    "WorkTicketID": 50345,

    "SysUserID": 1,

    "ExternalSystem": "Suddath Document System"

}

 

 

The following table describes the metadata referenced by this method.  The properties are grouped by related fields where, in some cases, only one property should be set.

 

Property

Description

Set the Document Content Location

The metadata does not contain the content of the document but it does contain a reference to where the content of the document is stored. 

Specify either ContentUri or InternalContentID to indicate where the document content is stored.

ContentUri

If the document content is stored outside of the MoversSuite Document Library, then set this property to the URL pointing to the physical location of the content.

Validation is not performed on the URL.  The Document API process assumes this URL is valid and that all MoversSuite Document Management users can access this location (e.g. avoid using drive letters that only work if the user is logged into the machine).

InternalContentID

If the document content is stored within the MoversSuite Document Library, then set this property to the value returned from the Add Document Content request.

Set the Description and Notes

The Description and Notes properties are optional and can be set to “null.”  However, MoversSuite strongly recommend entering a Description for each document added to the library.

Description

Provide a text description for the document.  If no Description is provided, then the description associated to that set for the Document Type property (below).

Notes

Enter any text notes related to the document

Set the Document Type

The Document Type is a code defined within the MoversSuite and is assigned to every document.  Document Type is a required field and may link to a document code supported by an external system.

If the Document Type relates to a work ticket, then the Work Ticket metadata property must be set as well.

Specify either Type or DocumentTypeID (not recommended) to the Document Type for this document.

Type

Set this to one of the Type values specified within Document Type Setup.

The Type, such as “BOL,” must link to the correct Interface and External Code. In the following example we want to set up a Type of “BOL” that matches a document code of “SBOL” on the Suddath system:

 

Example Document Type Setup records:

 

Document Type Field

Sample Value

Type

“BOL”

Description

“Bill of Lading”

Does this type include Work Tickets?

(unchecked)

Interface Item

Interface

“Suddath”

External Code

“SBOL”

 

In the above example an XML Interface Setup record must be defined for “Suddath.” For this interface, there must also be a XML System Setup record that contains “Documents” mapping record.

 

Example XML System Setup records:

 

XML System Field

Sample Value

Interface

“Suddath”

Internal System

“Suddath Document System”

External System

“Suddath Document System”

XML System Data Type Map

XML System Data Type

“Documents”

Name

“Suddath Documents”

 

 

DocumentTypeID

This is an internal identifier for the appropriate Type as defined within Document Type Setup. MoversSuite does not recommend setting the DocumentTypeID. Instead, use the Type setting (described above).

Set the Work Ticket

Set the Work Ticket when the document type indicates a work ticket type document (refer to the “Does this type include Work Tickets?” flag within Document Type Setup).

Specify either WorkTicketNumber or WorkTicketID to identify the correct work ticket record associated to this document.

WorkTicketNumber

Set this to the Sequence value from the WorkTickets table for the appropriate order (compare Orders.PriKey to WorkTickets.OrdersPriKey).

 

Note: The value can also be expressed as the entire work ticket number which is the actual Order Number and Sequence separated by a “-“.  For example, the fifth work ticket for order Z1234-2 would be “Z1234-2-5.”

 

WorkTicketID

Set this to the WorkTicketID value from the WorkTickets table for the appropriate order (compare Orders.PriKey to WorkTickets.OrdersPriKey).

Set the User being credited with adding/updating a document

Each document must specify a MoversSuite user (defined within Personnel Setup).  Several methods will attempt to set either the SysUserID or ExternalSystem.  On adds only: If neither is set, then the system will locate and set the user record where the First Name matches “External” and the Last Name matches “Application.”

Specify either SysUserID or ExternalSystem to identify the user updating this document:

SysUserID

Set this to the SysUserID from the Sysuser table for the correct user.  Users are defined within Personnel Setup.

 

Note: For updates, it is strongly recommended to always set the SysUserID.

 

ExternalSystem

If the DocumentTypeID property is set (above), then set this as prescribed in Step 2 of the DocumentTypeID propderty.

 

 

NOTE

A document that is added to the MoversSuite Document Library through the Document API service will be automatically uploaded to the UniGroup TransDocs system if the document type meets the auto upload requirements defined in the Document (Auto-Upload) Setup (in the case of an UniGroup order and the document is a TIFF or PDF file) just as if it was being added from the MoversSuite Document Viewer or through the PSIGEN document scanning system.