API variable in PHP to get all image by tags
Hi,
I'm trying to get all images by tags.
I follow this piece of code:
$api->resources_by_tag($tag, $options = array());
However, I receive the error:
"$api variable is not defined"
I have trouble understanding what is defined by $api, could you help me on that one.
0
-
Hi Edam,
You will need to first initialize the $api variable to be an instance of the Cloudinary/Api class.
For example, in your script, you would import the relevant classes -
require 'autoload.php';
require 'src/Api/Error.php';
require 'src/Api/NotFound.php';
require 'src/Api.php';Then create the object and call the relevant method -
$api = new \Cloudinary\Api();
$api->resources_by_tag($tag, $options = array());Please try this out and let me know how it goes.
0
Post is closed for comments.
Comments
1 comment