$image = $_POST['url'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://imgur-apiv3.p.mashape.com/3/image');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Client-ID ' . $client_id ));
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'X-Mashape-Key: ' .$Mashape_Key));
curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'image' => $image ));
curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'type' => 'url' ));
curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'name' => 'test_name' ));
curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'title' => 'test title' ));
curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'description' => 'blablabla' ));
$reply = curl_exec($ch);
var_dump($reply);
curl_close($ch);
В результате получаем ошибку:
string(112) "{"data":{"error":"Authentication required","request":"/3/image","method":"POST"},"success":false,"status":401}"
Вопрос - как сделать авторизацию(в чем она заключается) ?