Download Shutterstock images with ID and PHP

     

I'm currently modding this code : https://github.com/shutterstock/api/blob/master/examples/php-curl/v2.php


Goal is letting user input ID of image (using download https://developers.shutterstock.com/api/v2/images/download) get download links for each ids a save them on server/localhost.


I face problem building the download functions and echo the response :


public function download($id) {
$url = 'https://api.shutterstock.com/v2/images/licenses/'.$id.'/downloads';   $ch = curl_init($url);   curl_setopt($ch