Get a File
GET/files/ {fileId}/
v2
GET
file-get-file
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?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.getFile({
"fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"queryParameters": {
"accept": "application/octet-stream",
"content-disposition": "inline",
"token": "jwt"
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetFileRequest(
fileId: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
))
->withAccept("application/octet-stream")
->withContentDisposition("inline")
->withToken("jwt");
$response = $client->file()->getFile($request);
var_dump($response->getBody();