Get All Document Metadata

 

This method returns a list of metadata for all documents for a given date range and document type.

 

HTTP Verb/Method:

GET 

URL Format:

http://server/api/documents/created?from={FromDateTime}&to={ToDateTime}&type={DocType}&page={Page}&size={PageSize}

Returns:

The metadata for qualified documents returns upon a successful request.

 

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

 

Parameter

Description

FromDateTime

Enter the date (and optionally the time) to begin selecting documents on based on the date the document was added to the library (in “CCYY-MM-DD” format). 

If this parameter is not specified, the beginning date to select records on is January 1, 1990.

Optionally, a time value can be included as well.

See Document API Date Format for format definition.

ToDateTime

Enter the date (and optionally the time) to end selecting documents on based on the date the document was added to the library (in “CCYY-MM-DD” format). 

If this parameter is not specified, the end date to select records on is the current date and time.

Optionally, a time value can be included as well.

See Document API Date Format for format definition.

DocType

Optional

Select records based on a particular document type, such as “BOL” or “Work Ticket,” as defined within Document Type Setup.

The following two paging parameters are provided to avoid buffer overload. 

The default configuration for the MoversSuite API service is 128K for the entire response, therefore paging allows the requestor to make multiple requests using the same FromDateTime, ToDateTime, DocType (if specified), and PageSize values starting with Page of “1”.  Repeat this request for a higher Page count (2, 3, 4, and so on) until no more documents are returned.

Paging will work only if the ToDateTime is for a date/time that is the past (relative to the time zone of the Document API server).

Page

Optional

Enter a particular page number to list documents from (a value between 1 and 1000). 

PageSize

Optional

Enter the number of documents to return to a page (a value between 1 and 1000).

 

A sample request to return items 301 to 400 that were created between 2:30 p.m. and 2:35 p.m. on the date Sept 18, 2012 would be:

http://AServer/api/documents/created?from=2012-09-18T14:30:00&to=2012-09-18T14:35:00&page=4&pagesize=100

 

 

Notes on Using this Method as a Secondary Document System

 

If using the method continuously as a secondary document system, then following these points to ensure an accurate listing of documents:

    The time stored on a document when it is added is the local time on the MoversSuite SQL Server.

    Requests made to the server should be constructed relative to the time zone of the MoversSuite SQL Server.

    Performing a “select getdate()” SQL request from the MoversSuite SQL Server database would obtain the current date and time on the MoversSuite SQL Server and can be performed from any remote machine.

    Bear in mind that requests coming from a machine other than MoversSuite SQL Server may contain date and time that is different from that on the MoversSuite SQL Server.  This can lead to missing documents when specifying a specific time range to retrieve documents by.

    For the paging to work, the ending time for every request has to be some time in the past (according to the clock on the MoversSuite SQL Server).

    If the ending date time is in the future and paging is being used, then if any documents are added during the request(s), then there is no guarantee that all documents would be returned nor is there a guarantee that all documents are only being returned once.  For example, if the new document would have appeared on page two after page three has been returned, then that will push all documents down one slot.  Thus, the first document on page four will be the same document as the last one on the previously rendered page three and the new added document will have been missed.

    Keep track of the exact ending time (to the second) of the last request.  Use that exact value as the starting time for the subsequent request.  If a document was created at exactly the ending time of the request time span, then it does not appear on that report but will appear on the subsequent report. DO NOT (for example) add time (like a second) to one request’s ending time to set the starting time for the subsequent request.  The creation date of a document includes milliseconds and it is therefore possible to miss documents if there is a difference between the previous request’s ending time and the subsequent request’s starting time.