Get All Metadata by Order

 

This method returns the document metadata for all documents of a specified order.

 

HTTP Verb/Method:

GET 

URL Format:

http://server/api/documents/{OrderID}?operation=all&sortField={SortField}&sortDescending={true|false}&showDeletedDocs={true|false}

Returns:

This method returns the metadata for all document associated to the specified order (see the Request Return section below).

An error returns if the document metadata does not exist.

 

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

 

Parameter

Description

OrderID

Provide the primary key of the requested MoversSuite order (Orders.PriKey).

operation

This parameter must be set to “all.” This setting instructs the request on which portion of the metadata to retrieve.

sortField

Provide the type of sort you wish to have on the data returned. This parameter works in conjunction with the sortDescending option to determine whether the data sorts in ascending or descending order.

 

The following options are available:

 

DateModified

Set this option to return documents sorted in the order in which they were last updated. The application references the Modified On date in Properties.

 

DocumentDescription

Set this option to return documents sorted in the order of the document description. The application references the Description field in Properties.

 

WorkTicketNumber

Set this option to return documents sorted in the order of the work ticket number associated to the document. The application references the Work Ticket Number field in Properties; the document must be a work ticket type (see Work Ticket Number field description within the Properties topic for more information).

 

sortDescending

Set this to “True” to instruct the application to return the documents in the sort order specified under the sortField parameter in descending order (A to Z or newest to oldest). Conversely, set this parameter to “False” to return documents in ascending order.

showDeletedDocs

Set this parameter to “True” to include only those documents deleted from the system in the results returned. MoversSuite does not physically remove any document that a user deletes (through Document Management), therefore they remain in the system but they are not visible within the MoversSuite application. Set this this to “False” to list only non-deleted documents in the results.

 

 

Request Return

 

Metadata returns in JSON format as follows:

 

[{

    "ContentUrl": "http:\/\/Server\/api\/invoices\/7583\/1?download=true",

    "Created": "2007-02-26T17:33:06",

    "Modified": "2007-02-27T12:07:18",

    "Description": "Invoice: 3055A- - - \/1",

    "DocID": 1783,

    "DocumentUrl": "http:\/\/ Server \/api\/invoices\/7583\/1",

    "ModifiedBy": "Lausanne Lora",

    "Name": "3055A- - - (1).pdf",

    "Notes": "Invoice Status: Invoice\u000d\u000aInvoice Amount: $1,465.10\u000d\u000aInvoice Date: 02\/26\/2007",

    "OrderID": 7583,

    "OrderUrl": "http:\/\/Server\/api\/orders\/7583",

    "Source": "Invoices",

    "Type": "MS Invoice",

    "WorkTicketNumber": null

}, {… }]

 

The following table describes the metadata returned by this method.

 

Property

Description

ContentUrl

Retrieve the actual content of a document using this value through a HTTP GET operation.

Created

Returned here is the creation date of the document.

This date is formatted in “CCYY-MM-DDThh:mm:ss” format (see Document API Date Format).

Modified

The date and time the document was last modified is returned in this property.  This date is updated each time the document is modified, which includes changes to content and/or metadata.

This date is formatted in “CCYY-MM-DDThh:mm:ss” format (see Document API Date Format).

Description

This is the text description of the document.

DocID

This value contains the unique document ID stored within the MoversSuite Document System.

DocumentUrl

Use the value entered here to retrieve the metadata for the document.  Perform the request using an HTTP GET operation to retrieve the data or perform the request as a HTTP PUT operation to update the metadata of the document (refer to the Add Document Metadata method for more information).

 

Note:

MoversSuite invoices cannot be updated.

 

ModifiedBy

This property contains the name of the user who last modified this document.

Name

The name of the document or the file name of the document is returned in this property.

Notes

Any notes assigned to the document are returned in this property.

OrderID

This is the identification for the order associated to the document.  The OrderID is typically the primary key of the order in the Orders table (Order.PriKey).

OrderUrl

This property contains the URL that references the metadata for the order associated to the document.  Use an HTTP GET operation referencing this URL to retrieve the metadata (refer to the Basic Order Information Request service for a related request).

Source

One of the following source types is returned with this property:

“Documents” indicates a document-type file source that can be updated

“Invoices” indicates a MoversSuite invoice and cannot be updated (read-only)

 

Type

Returned here is the type assigned to the document. 

Document types are defined within Document Type Setup

 

Note: Invoices will be assigned to a Document Type of “MS Invoice.”

 

WorkTicketNumber

If the document is a work ticket, this property displays the work ticket number assigned to the document.

Work ticket documents are those associated to a Document Type Setup record with the “Does this type include Work Tickets?” flag checked.