Open a document from the customer portal
The url a document carries on the customer's portal page. The token in the path is the whole authorization: there is no login and no permission check. Every request is judged afresh, and the document opens only while the portal link the token was issued under still works and the document is still on the service order, still marked customer-visible, still stored privately in Flow Retail, still in the SERVICE category and on no other service order. The answer is a redirect to a short-lived address for the file itself, which the browser follows to show or download it; that address stops working within five minutes, and a document link is never a permanent link to the file. A link that no longer works is answered with a redirect to the portal's page for a link that has stopped working (/portal/unavailable on the portal's own address), which carries nothing about the link and chooses its language from the browser, rather than an error body: the link is opened by the browser directly, so the portal page never sees the refusal. A token that is malformed or was never issued is answered the same way, because the answer never reveals which it was. The document stays openable after the service order reaches a terminal state for as long as the portal token lives, as the page stays readable.
The key a document link carries. It opens one customer-visible document on one service order and reaches nothing else — not the service order's portal page, not its other documents. It is not a portal token: neither is ever accepted as the other. It works only while the portal link it was issued under works: regenerating the service order's portal link kills it for good, it is refused while the portal token is past its expiry and works again when a reopen brings the portal link back, and a document that is not customer-visible, not on the service order, not stored privately in Flow Retail, not in the SERVICE category, on another service order as well, or no longer exists cannot be opened through it while that lasts; deletion is final. A document that was already opened can stay reachable for up to five minutes after its link stops working.
The document may be opened, or the link no longer works. The Location header is a short-lived address for the file, valid for up to five minutes, or the portal's page for a link that has stopped working.
Too many requests for this link. Document links are rate limited per link, whatever the address the requests come from, as every portal route is, and a request over the limit is refused rather than answered. The limit is judged before the token and counts every request whatever the token, so a 429 says nothing about whether the link works.
GET /v2/portal/documents/{documentToken} HTTP/1.1
Host: api.flowretail.com
Accept: */*
No content
Last updated
Was this helpful?

