Skip to content
Download Beeper

Serve a file

$client->assets->serve(string url): serve
GET/v1/assets/serve

Stream a file given an mxc://, localmxc://, or file:// URL. Downloads first if not cached. Supports Range requests for seeking in large files.

ParametersExpand Collapse
url: string

File URL to serve. Accepts mxc://, localmxc://, or file:// URLs.

ReturnsExpand Collapse
mixed

Serve a file

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(accessToken: 'My Access Token');

$response = $client->assets->serve(url: 'x');

var_dump($response);
Returns Examples