From 3f528f27b9b4e72c6a0a850fd17ae83520f54d1e Mon Sep 17 00:00:00 2001 From: Ionut Marchis Date: Mon, 23 Nov 2015 13:25:47 +0200 Subject: [PATCH] postInfo() --- lib/Tumblr/API/Client.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/Tumblr/API/Client.php b/lib/Tumblr/API/Client.php index 92b656b..3341b28 100644 --- a/lib/Tumblr/API/Client.php +++ b/lib/Tumblr/API/Client.php @@ -387,6 +387,28 @@ private function getRequest($path, $options, $addApiKey) return $this->parseResponse($response); } + /** + * Make a GET request to the given endpoint and return the response + * + * @param $blogName + * @param $postId + * @param bool $addApiKey whether or not to add the api key + * + * @internal param string $path the path to call on + * @internal param array $options the options to call with + * @return array the response object (parsed) + */ + public function getPostInfo($blogName, $postId, $addApiKey) + { + $options = [ + 'id'=> $postId, + 'notes_info'=>true, + 'reblog_info'=>true + ]; + $path = $this->blogPath($blogName, '/posts'); + return $this->getRequest($path, $options, $addApiKey); + } + /** * Make a POST request to the given endpoint and return the response *