cURL
curl -X GET \
/media/{id} \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/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://coreapi.io/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://coreapi.io/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;
}{
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"mediaFolder": {
"name": "invoice"
},
"isPrivate": true,
"mimeType": "image/jpeg",
"fileExtension": "jpg",
"fileName": "invoice.jpg",
"storageFileName": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ.jpg",
"createdAt": "2021-01-01T00:00:00+00:00"
}Media
Get a media
Get a media by id
Required permissions:media:readGET
/
media
/
{id}
cURL
curl -X GET \
/media/{id} \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/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://coreapi.io/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://coreapi.io/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;
}{
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"mediaFolder": {
"name": "invoice"
},
"isPrivate": true,
"mimeType": "image/jpeg",
"fileExtension": "jpg",
"fileName": "invoice.jpg",
"storageFileName": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ.jpg",
"createdAt": "2021-01-01T00:00:00+00:00"
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
Media identifier
Antwort
Media resource
Beispiel:
"01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
Show child attributes
Show child attributes
Whether the media is public accessible or not
Beispiel:
true
The mime type of the media
Beispiel:
"image/jpeg"
The file extension of the media
Beispiel:
"jpg"
The original file name of the media
Beispiel:
"invoice.jpg"
The file name of the media in the storage
Beispiel:
"01F9Z3ZJXZQZJZJZJZJZJZJZJZ.jpg"
The date and time when the media was created
Beispiel:
"2021-01-01T00:00:00+00:00"
War diese Seite hilfreich?