Add a Document via Direct Upload

Directly uploading a file for you port order is a two step operation; first you will request a storage location from the Flowroute Servers. This is a time sensitive URL located in Amazon's S3 storage facility.

Next you will use a PUT method to upload your file to the specified URL.

Your document is encrypted during transmission and at rest when it reaches its final destination.

Method

POST portorders/:portorder_id/upload_file

Body Parameters

  • filename
    string Required

    The full path to the file to be uploaded.

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.

Upload the File

Now that we have the S3 URL, its time to upload the file. Next you will use a PUT method to upload your file to the specified URL.

Your document is encrypted during transmission and at rest when it reaches its final destination.

Method

PUT

Body Parameters

  • filename
    string Required

    The full path to the file to be uploaded.


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/mybill.pdf"
}

								
                            

Example Request

								
curl -X POST https://api.flowroute.com/v2/portorders -u accessKey:secretKey -d '{"data":{"attributes":{"numbers":["12065013456","18002546788"],"loa_details":{"email":"mbermudez@flowroute.com","cc":"mbermudez+test@flowroute.com"},"billing_name":"John Doe","city":"Seattle","country":"US","provider":"Verizon","state":"WA","street":"1218 3rd Ave","usage_type":"Residential","zip":"98101","alias":"Port Order 6/12/2018","business_documents":["https://s3-us-west-2.amazonaws.com/port-order-docs/csr.pdf","https://s3-us-west-2.amazonaws.com/port-order-docs/bill.pdf"],"company":"Leather Inc.","desired_completion_date":"2018-07-12","enable_cnam_lookups":true,"provider_account":"123ABC","status_url":"https://ycx56aoy9j.execute-api.us-west-2.amazonaws.com/dev/message_to_slack"}}}' -H 'Content-Type':'application/json'
								
                            

Example Response

Error

	  						
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Request has expired</Message>
<Expires>2018-07-31T21:34:17Z</Expires>
<ServerTime>2018-07-31T21:59:53Z</ServerTime>
<RequestId>DE165F72257E13D8</RequestId>
<HostId>sR9Nd3c8C9DARSHQfpSaIp24BRRqRz2QkaYJYpxCwyMpa3RycZXA7gorfZEkAnvbpE0ahO47ZYI=</HostId></Error>
  	     			        
                        

Success

200 OK

							
{
	"data": {
		"attributes": {
			"expires": "2018-07-31T21:34:17.576092+00:00",
			"url": "https://porting-uploads-staging.s3.amazonaws.com/4/40093/bc3fd888-55af-569b-84fb-bfa19810578d/test.pdf?AWSAccessKeyId=ASIAJHBFNLMGW4TZWKSA&content-type;=application%2Fpdf&Expires;=1533072857&x-amz-security-token;=FQoDYXdzEDUaDBSPWJQDOsBj5epBFSKZBIJCbivrhJZQUviBdNiZMoCl2kz8gBrJJGqYjdsj%2BfV9gd8ij310fAonU5MbSMjRW3LabrpQSOdBQwVFiSaxMPGP7MhV0KopybSWgdbpgb58RPCuFGThpkIA2al2GvenKaJTLZx2KO62h%2BhsmroMkx7GwnY7u3mx2122oJJ%2FnB7faIrxmdwLgKKDzI%2BRy6GWTAWs302SD0fWXiS21XQiniFl1%2F1SkScFVd4sOKNTyeyECOmXBme82c1Kqm1yEG9EKDrCO9wbzaQE32Fg0yZPIg9c66akU2mWpF9vbN5OEfrvN5sc4KoAoY5zGVEfMwP6OSt17X5BMLtceCCQxADk%2B6oxGriubg%2BhPvXGvg5%2FygeP7DXKEgKiK1P3t2bmtTHJswa8%2FgALRVEOzbOhZgCBi9e7MEocp8LKq%2FwCBPRnG39dqcVhbukRZX05a1hXeAi9MABaS7IUjocKPekQGmruOseUazRAnllwLyMhRoRJkuMGW7RhQ8JyClgzyKt0B0hW0ClgH6BkYhxq42f3X%2BPoMWIX6E6pR%2Fj6xyTXKmaabt2wN%2BXV7fpbUBJJMQ%2BdFRKHfXbDqPD4l7%2BfS%2FKegXLz%2BdL5RGJSorU59%2B86dEf5Wj27cXeNUOJe9BMd2EUVeoAouOJv0vN3QzRVARRNvySPqYLyo7FwpcwR43KLOc0dc63ZAJOEwMwnsKi7hWEsVTlDNZgHtqqQ05IoXiix%2B4LbBQ%3D%3D&Signature;=MkGYkKFPc%2BjU7HG0qbCfmfJVors%3D"
		},
		"id": "50987",
		"links": {
			"self": "https://api.flowroute.com/v2/portorders/40093/files/50987"
		},
		"type": "portorder-file-url"
	}
}
                            
                        

Example Request

                            
PUT "https://porting-uploads-staging.s3.amazonaws.com/4/40093/bc..." HTTP/1.1
Content-Type: application/pdf

{
  "filename": "/fullpath/to/mybill.pdf"
}

                                
                            

Success

                            
200 OK