02 One API hop ("give me a download link")

  "download": {
    "url": "https://api.example.com/books/{id}/download",
    "method": "POST",
    "headers": { "Authorization": "Bearer {token}" },
    "body": "{}",
    "url_path": "url"            // answer: {"url": "https://cdn.example.com/signed/..."}
  }

- The hop answer must be JSON, <= 48 KB.
- If url_path returns a full URL, the file GET is sent without your headers (pre-signed URLs often reject a second auth).
- If it returns a server path (/files/12), it's joined to the API origin and your headers are sent.
- On an error, the screen shows Download failed (HTTP 404): <error or message from the JSON>.
‹ PreviousReader file (.txt)Next ›