I am trying to pull the JSON data for a Vine via the oEmbed API. The request works fine in the browser and on my local machine and another server. This is my code
$curl_url = 'https://vine.co/oembed.json?url=https%3A%2F%2Fvine.co%2Fv%2FMl16lZVTTxe';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "com.vine.iphone/1.0.3 (unknown, iPhone OS 6.1.0, iPhone, Scale/2.000000)");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
curl_close($ch);
if (!$result){echo curl_error($ch);}
print_r($result);
But as soon as I run it on My Rackspace server, on the Texas Region, it throws a HTML formatted as text response 500 Internal Server Error as text (Actual http status code is 200). I have added link of the screenshot of the response below for reference.
Image of the response from vine/twitter
I have talked with Rackspace Support and it seems that Twitter / Vine side preventing our server's IP from reaching API. I have also posted on twitter about it, but no response from them - https://twittercommunity.com/t/vine-oembed-500-internal-server-error-rackspace-server/56478.
My ultimate goal is to get the thumbnail for the video without getting an Internal Server Error.