Get a download URL

Get a link that opens the file itself. For an ordinary stored file the link is freshly made for you and works for fifteen minutes, whether the file is private or public. Make a new one whenever you need it rather than saving the link. For a file published to IPFS the link is its permanent public address and does not expire. The answer is always a small JSON object; fetch the `url` inside it as a second request. Requires the `storage.read` permission.

GET
/assets/{assetId}/download
AuthorizationBearer <token>

The access token returned after a successful sign-in, sent as Authorization: Bearer <access_token>.

It identifies the person and the organization they are working in, and it lasts about fifteen minutes. When it runs out, use their refresh token at POST /auth/refresh-token instead of asking them to sign in again.

In: header

Path Parameters

assetId*string

Identifier of the asset, as returned by POST /assets.

Query Parameters

noRedirect?boolean

Return the asset's URL rather than redirecting to it.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.dual.network/assets/665f1c2d4b1a2c3d4e5f6a10/download"

{
  "url": "https://storage.googleapis.com/example-bucket/665f1c2d4b1a2c3d4e5f6aa0/assets/665f1c2d4b1a2c3d4e5f6a10?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Expires=900&X-Goog-Signature=..."
}

{
  "code": 3,
  "message": "Key: 'limit' Error:Field validation for 'limit' failed on the 'lte' tag"
}

{
  "code": 16,
  "message": "no auth provided"
}

{
  "code": 5,
  "message": "object not found"
}
{
  "code": 13,
  "message": "internal error"
}