Vine oEmbed Internal Server Error

vine

#1

I am trying to pull the JSON data for a Vine via the oEmbed API endpoint created for them. The request works fine in the browser and on my local Vagrant machine, but as soon as I run it on the server, it throws a 500 Internal Server Error.

$url = 'https://vine.co/oembed.json?url=http://vine.co/v/egXzgWMjrTj';
$res = file_get_contents($url);
$json = json_decode($res);

I have already tried using a cURL request and passing in stream_create_context() with headers into the file_get_contents() call.

My example cURL request returning HTML formatted 500 Internal Server Error

$url = 'https://vine.co/oembed.json?url=http://vine.co/v/egXzgWMjrTj';
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);

My ultimate goal is to get the thumbnail for the video and I am performing similar requests to Vimeo and Instagram without getting an Internal Server Error.

EDIT:
It is as if my Rackspace server has been blocked from making requests to their API, but this is the first time I have ever attempted to make requests to Vine.


#2

Throws a 500 error on your server or Vines? I was getting similar errors until I changed json_decode($res) to json_decode($res, true)


#3

Hi ,

I am using curl to get embed code.

When I execute in my local setup working fine.

When I execute on my servers it returns 500 error. I am able make other twitter api calls .

Pasting code here:

$ch = curl_init();
$url = ‘https://vine.co/oembed.json?url=https://vine.co/v/edeJePhVFE9’;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($output, 0, $header_size);
$body = substr($output, $header_size);
curl_close($ch);

Thanking you in advance.

Regards,
Praveen


#4

I am running this from the command line on my server and the response being returned is a 500 error. There is no response to run through json_decode().


#5

This is similar to an issue Twitter was having in Fall 2014. Vine API seems to be blocking RackSpace IP block from accessing Content. Vine / Twitter, can you let us know if there is a way to resolve this. Please feel free to reply to me directly. I am a System Administrator that works with the Original Poster.