curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"mediaUrl": "https://img.ayrshare.com/012/vid.mp4"}' \
-X POST https://api.ayrshare.com/api/media/urlExists
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/media/urlExists", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
mediaUrl: "https://img.ayrshare.com/012/vid.mp4"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'mediaUrl': 'https://img.ayrshare.com/012/vid.mp4'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/media/urlExists',
json=payload,
headers=headers)
print(r.json())
<?php
require 'vendor/autoload.php';// Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'POST',
'https://api.ayrshare.com/api/media/urlExists',
[
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer API_KEY'
],
'mediaUrl' => 'https://img.ayrshare.com/012/vid.mp4'
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
{
"status": "success",
"statusCode": 200,
"contentType": "image/jpeg"
}
{
"status": "error",
"statusCode": 404,
"statusText": "Not Found"
}
Media
Verificar que la URL del medio existe
Verifica que el archivo de medio existe
POST
/
media
/
urlExists
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"mediaUrl": "https://img.ayrshare.com/012/vid.mp4"}' \
-X POST https://api.ayrshare.com/api/media/urlExists
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/media/urlExists", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
mediaUrl: "https://img.ayrshare.com/012/vid.mp4"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'mediaUrl': 'https://img.ayrshare.com/012/vid.mp4'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/media/urlExists',
json=payload,
headers=headers)
print(r.json())
<?php
require 'vendor/autoload.php';// Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'POST',
'https://api.ayrshare.com/api/media/urlExists',
[
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer API_KEY'
],
'mediaUrl' => 'https://img.ayrshare.com/012/vid.mp4'
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
{
"status": "success",
"statusCode": 200,
"contentType": "image/jpeg"
}
{
"status": "error",
"statusCode": 404,
"statusText": "Not Found"
}
Verifica que el archivo de medio existe una vez subido. Debe usarse junto con el endpoint /media/uploadUrl.
Parámetros del header
Verificar que la URL del medio existe
POST https://api.ayrshare.com/api/media/urlExists
Verifica que el archivo de medio existe una vez subido. Debe usarse junto con el endpoint /media/uploadUrl.
También recibirás el contentType del archivo de medio.
Se realiza una solicitud HEAD a la URL del medio para verificar que existe.
Asegúrate de que el proveedor de hosting no esté bloqueando la solicitud HEAD.
Parámetros del body
URL del medio cuya existencia se quiere verificar.
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"mediaUrl": "https://img.ayrshare.com/012/vid.mp4"}' \
-X POST https://api.ayrshare.com/api/media/urlExists
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/media/urlExists", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
mediaUrl: "https://img.ayrshare.com/012/vid.mp4"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'mediaUrl': 'https://img.ayrshare.com/012/vid.mp4'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/media/urlExists',
json=payload,
headers=headers)
print(r.json())
<?php
require 'vendor/autoload.php';// Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html
$client = new GuzzleHttp\Client();
$res = $client->request(
'POST',
'https://api.ayrshare.com/api/media/urlExists',
[
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer API_KEY'
],
'mediaUrl' => 'https://img.ayrshare.com/012/vid.mp4'
]
);
echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
{
"status": "success",
"statusCode": 200,
"contentType": "image/jpeg"
}
{
"status": "error",
"statusCode": 404,
"statusText": "Not Found"
}
⌘I
