Request a Document Pull

The second method to upload a document to your port order is to have the Porting service retrieve your document from a public location. In that case, you specify the URL of your file.

Method

POST portorders/:portorder_id/upload_file

Body Parameters

  • filename
    string Required

    The full path to the file to be uploaded.

  • Optional Query Parameters

  • filename
    string

    Allows the user to specify a friendly name to refer to this file content. Mainly used when the URL is some sort of complex server side request.

Response Fields

On success, the HTTP status code in the response header is 200 OK and the response body contains information on the document request. On error, the header status code is an error code and the response body contains an array of error objects.

  • data
    object

    Document request object composed of the following:

    • attributes
      object

      Object composed of attributes relating to the state of the request.

      • filename
        object

        The original URL specified in the request.

      • file
        object

        The 'shortened' name of the file if specified.

      • status
        object

        The status of the document upload. Possible status values are:

        • pending
        • processing
        • complete
        • error
    • id
      integer

      ID assigned to the document process.

    • links
      object

      Links object pointing to the status for this document.

      For example, https://...portorders/394822/files/99999.

    • type
      string

      This will always be portorder-file.

Example Request

                                
POST /v2/portorders/portorder_id/upload_file HTTP/1.1
Content-Type: application/json
Accept: application/json

{
    "filename": "/fullpath/to/carrer_bill.pdf?filename=carrier_bill.pdf"
}
                                
                            

Example Request

                                
curl -X POST https://api.flowroute.com/v2/portorders/:portorder_id/upload_file -u accessKey:secretKey -d '{"filename": "/fullpath/to/carrer_bill.pdf?filename=carrier_bill.pdf"}' -H 'Content-Type':'application/json'
                                
                            

Example Response

Success

200 OK

                            
{
  "data": {
    "attributes": {
      "filename": "https://example.com/images/header/carrier_bill.pdf?filename=carrier_bill.pdf",
      "file": "carrier_bill.pdf",
      "status": "processing"
    },
    "id": "51026",
    "links": {
      "self": "https://api.flowroute.com/v2/portorders/40093/files/51026"
    },
    "type": "portorder-file"
  }
}