Document Retrieval REST Service

Document Retrieval Web Service
Southeastern Freight Lines provides a web service that allows partners to send HTTP requests
to automatically retrieve documents. To use this service, you must have a MySEFL account associated with the pro numbers.
To sign up for a MySEFL account: request an ID and password.

General REST Service Information
The SEFL Document Retrieval service uses a REST architecture to expose an endpoint that will accept a JSON body and parse it to retrieve documents for pro numbers.

To use this service, send an HTTP POST request to the web service endpoint found below.
The web service will receive this request, validate, and return a response.

Endpoint: http://www.sefl.com/document-retrieval/

Request

Example Request includes:
  • "imageTypes" : required list of requested document types.
    • "BL" : Bill of Lading
    • "DR" : Delivery receipts
    • "MS" : Miscellaneous
  • "associated" : boolean to return documents for associated pros. default=false
  • "format" : format of documents. default=tif

Response

Example Response includes for each document:
  • "pro" : pro number of this document
  • "base64Image" : field which will then have to be decoded back to binary in order to be viewed
  • "fileExt" : file extension of document
  • "type" : type of shipping document
    • "Bill of Lading"
    • "Delivery receipts"
    • "Miscellaneous"
  • "error" : any error message if we were unable to retrieve the document

Headers
For validating login credentials, a header named Authorization is required.
The value of this header should be a string containing 'Basic ' followed by a base 64 encoded string
containing your MySEFL username and password (use the format username:password).
Below is an object containing the required headers with example values:
    headers: {
        "Authorization" : "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", 
        "Content-Type" : "application/json",
        "Accept" : "application/json"
    }
                                
Error Responses
In the event that a required header is missing, or if the login validation fails, an empty HTTP response will be returned with a status of 401 - Unauthorized. The web service will return a response in all cases, however if an error occurs, documents will not be returned. If a server error occurs, the response will contain a fault message.

In some cases, the request may not pass our internal validation, such as the MySEFL account not having access to a pro.
In these cases, an error message will be returned that specifies which validation failed, for example:
    {
        "pro": "123456789",
        "type": "",
        "version": "",
        "fileExt": "",
        "base64Image": "",
        "error": "This Login ID does not have access to 123456789"
    }
                                
Developer Testing
Developers may test connection and validation by sending an HTTP GET request to the following endpoint:
https://www.sefl.com/document-retrieval/example
This will test the connection, perform server-side login validation, and return a test document.

Legacy Documentation
We recommend using the REST API, however if you have a system that specifically requires the url parameters,
please use the following:

If you wish to have the images returned in XML, use the following query string. Additional options can also be appended.

https://www.sefl.com/webconnect/documentretrievalXML?RefNum=9999999&DR=Y&Username=XXXX&Password=XXXX

The image will be returned in Base64 within the "base64Image" tag which will then have to be decoded back to binary in order to be viewed.
The other information returned in the XML tags will be the image type (ex. "Bill of Lading"), the pro number associated with the image, and the file extension of the image.
The default image type for documents is tiff. To retrieve images in pdf format, append the parameter pdf=Y to the query string.