Downloading a file from your port order is a two-step operation; first you will request a temporary storage location from the Flowroute Servers. This is a time sensitive URL located in Amazon's S3 storage facility.
Next you will use a GET method to download your file from the specified URL.
Your document is encrypted during transmission and at rest.
Method
GET portorders/:portorder_id/files/:file_idResponse 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
objectDocument request object composed of the following:
attributes
objectObject composed of attributes relating to the state of the request.
url
stringThe time sensitive document download URL.
expires
stringThe time that the document upload URL expires.
id
integerID assigned to the document process.
links
objectLinks object pointing to the status for this document.
For example, https://...portorders/394822/files/99999.
type
stringThis will always be portorder-file-url.
Download the File
Now that we have the S3 URL, it's time to download the file. Next you will use a GET method to download your file from the specified URL.
Your document is encrypted during transmission and at rest.
Method
GET S3 URLResponse Fields
On success, the HTTP status code in the response header is 200 OK and the response body will be empty. On error, the header status code is an error code and the response body contains an XML error document.
Step 1
Example Request
GET /v2/portorders/:portorder_id/files/:file_id HTTP/1.1
Accept: application/json
Example Response
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"
}
}
Step 2
Example Request
GET S3_URL HTTP/1.1
Example Response
Success
200 OK
Error
401 UNAUTHORIZED
<?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>
Step 1
Example Request
curl https://api.flowroute.com/v2/portorders/:portorder_id/file/:file_id \
-u accessKey:secretKey
Example Response
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"
}
}
Step 2
Example Request
curl -O S3_URL
Success
200 OK
Error
401 UNAUTHORIZED
<?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>