Get a File with user-friendly url
GET/files/ {fileId}/ {fileName}/
v2
GET
file-get-file-with-name
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/files/3fa85f64-5717-4562-b3fc-2c963f66afa6/me.jpeg?accept=application%2Foctet-stream&content-disposition=inline&token=jwt
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.file.getFileWithName({
"fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"fileName": "me.jpeg",
"queryParameters": {
"accept": "application/octet-stream",
"content-disposition": "inline",
"token": "jwt"
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\File\GetFileWithName\GetFileWithNameRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetFileWithNameRequest(
fileId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
fileName: "me.jpeg"
))
->withAccept("application/octet-stream")
->withContentDisposition("inline")
->withToken("jwt");
$response = $client->file()->getFileWithName($request);
var_dump($response->getBody();