Skip to main content
GET
/
v1
/
customers
/
{id}
/
expose
/
{media_id}
Expose Media
curl --request GET \
  --url https://{defaultHost}/v1/customers/{id}/expose/{media_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{defaultHost}/v1/customers/{id}/expose/{media_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{defaultHost}/v1/customers/{id}/expose/{media_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/customers/{id}/expose/{media_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{defaultHost}/v1/customers/{id}/expose/{media_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/customers/{id}/expose/{media_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{defaultHost}/v1/customers/{id}/expose/{media_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "e0793c93-9cd3-44f9-8ed7-0522b8ce51b2",
  "object": "media",
  "alt": null,
  "byte_size": 12254,
  "content_type": "image/png",
  "extension": "png",
  "filename": "test.png",
  "height": null,
  "public_access": false,
  "release_json": null,
  "title": null,
  "url": "http://app.example.com/file_redirect/eyJfcmFpbHMiOnsiZGF0YSI6IjMwZWJlMDk5LTY3M2MtNGYxNi1hMjE4LWYxOWZmNjY2MGM4OCIsImV4cCI6IjIwMjYtMDYtMjZUMTU6MTI6MDMuMjE1WiIsInB1ciI6ImJsb2JfaWQifX0=--5120a764834927d26f326f0452f79f5437de2d8c/test.png?disposition=attachment",
  "width": null,
  "url_expires_at": 1782486723,
  "created_at": 1782485822,
  "updated_at": 1782485822
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

media_id
string
required
id
string
required

Query Parameters

expose_for
integer

Sets how long a private media URL should be valid for, in seconds. The max value allowed is 86400 or 24 hours. When exposing a media through a purchase or license the default value is 900 or 15 minutes.

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

byte_size
integer

The size of the media in bytes.

content_type
string

The content type (i.e. image/png, image/jpg, application/pdf).

extension
string

The extension (i.e. png, jpg, pdf).

filename
string

The full filename with extension.

height
string | null

If the media is an image, this will be the height in pixels.

public_access
boolean

Whether or not this media is publicly accessible.

release_json
object | null

The JSON that was extracted from the release.json file within the ZIP file.

url
string | null

The URL for accessing this media. If the media is public, this will be a permanent URL. If the media is private, this will be a short-lived URL if the media has been exposed.

url_expires_at
integer | null

The time at which the URL expires. This will only be present if the media is private and has been exposed.

width
string | null

If the media is an image, this will be the width in pixels.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.