I am having difficulty using the tumblr-api to call posts from a blog. I am using the api console to get the code that gives me the variables for this, although i do not understand how to get those variables and output them to html.
$client = new Tumblr\API\Client('PRIVATE KEY');
// Make the request
$client->getBlogPosts('tecksup.tumblr.com', array('type' => 'text', 'limit' => 6, 'filter' => 'text'));
this gets the variables as far as i know. Does anybody know how to call the variables(blogs, only two on this one) for an echo statement or at least to get the text to be formatted in the code after this? This page has the documentation but I do not understand how to use what they are sharing.
It's usual for web API's to deliver the requested data as a JSON file. Not so usual but possible is to deliver in XML, HTML TEXT, or a propietar format.
The process is the same, you have to decode the deliveredn data, assign to a variable, and loop the data as needed.
Tumbler response is a JSON formatted file.
Use json_decode.