dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:

Home Page:https://developers.pinterest.com/docs/getting-started/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getMeBoards not working

shoaibhassanPurelogics opened this issue · comments

i user $boards = $pinterest->users->getMeBoards(); and the baords are not returning the boards but return this response

object(DirkGroenen\Pinterest\Models\Collection)#470 (5) {
  ["items":"DirkGroenen\Pinterest\Models\Collection":private]=>
  array(0) {
  }
  ["model":"DirkGroenen\Pinterest\Models\Collection":private]=>
  string(5) "Board"
  ["pagination"]=>
  bool(false)
  ["master":"DirkGroenen\Pinterest\Models\Collection":private]=>
  object(DirkGroenen\Pinterest\Pinterest)#463 (3) {
    ["auth"]=>
    object(DirkGroenen\Pinterest\Auth\PinterestOAuth)#466 (4) {
      ["client_id":"DirkGroenen\Pinterest\Auth\PinterestOAuth":private]=>
      string(19) "4991156703675310972"
      ["client_secret":"DirkGroenen\Pinterest\Auth\PinterestOAuth":private]=>
      string(64) "e483215bd97561436734dab083c4b96c80cc43fe8dbdd01e1ca9e0144d5982f9"
      ["state":"DirkGroenen\Pinterest\Auth\PinterestOAuth":private]=>
      string(7) "6f29a13"
      ["request":"DirkGroenen\Pinterest\Auth\PinterestOAuth":private]=>
      object(DirkGroenen\Pinterest\Transport\Request)#465 (4) {
        ["host":"DirkGroenen\Pinterest\Transport\Request":private]=>
        string(29) "https://api.pinterest.com/v1/"
        ["access_token":protected]=>
        string(76) "ArZwzFt8O9jiDYUhKLO8rEmNsrMgFfjSvyKDD1dFRCaT5OBjfAlUgDAAAz4URpWg5i7gzNEAAAAA"
        ["curlbuilder":"DirkGroenen\Pinterest\Transport\Request":private]=>
        object(DirkGroenen\Pinterest\Utils\CurlBuilder)#464 (2) {
          ["curl":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
          resource(322) of type (curl)
          ["headers":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
          NULL
        }
        ["headers":"DirkGroenen\Pinterest\Transport\Request":private]=>
        array(16) {
          [0]=>
          string(12) "HTTP/2 308 
"
          ["content-type"]=>
          string(24) "text/html; charset=utf-8"
          ["location"]=>
          string(39) "https://api.pinterest.com/v1/me/boards/"
          ["pinterest-generated-by"]=>
          string(27) "coreapp-ngapi-prod-0a01ca0a"
          ["x-envoy-upstream-service-time"]=>
          string(1) "4"
          ["vary"]=>
          string(15) "Accept-Encoding"
          ["content-encoding"]=>
          string(4) "gzip"
          ["cache-control"]=>
          string(7) "private"
          ["x-pinterest-rid"]=>
          string(16) "5894424023236689"
          ["content-length"]=>
          string(3) "245"
          ["date"]=>
          string(29) "Tue, 03 Mar 2020 15:19:13 GMT"
          ["set-cookie"]=>
          string(45) "_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure"
          ["x-cdn"]=>
          string(6) "akamai"
          ["age"]=>
          string(1) "0"
          [1]=>
          string(1) "
"
          [2]=>
          string(0) ""
        }
      }
    }
    ["request"]=>
    object(DirkGroenen\Pinterest\Transport\Request)#465 (4) {
      ["host":"DirkGroenen\Pinterest\Transport\Request":private]=>
      string(29) "https://api.pinterest.com/v1/"
      ["access_token":protected]=>
      string(76) "ArZwzFt8O9jiDYUhKLO8rEmNsrMgFfjSvyKDD1dFRCaT5OBjfAlUgDAAAz4URpWg5i7gzNEAAAAA"
      ["curlbuilder":"DirkGroenen\Pinterest\Transport\Request":private]=>
      object(DirkGroenen\Pinterest\Utils\CurlBuilder)#464 (2) {
        ["curl":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
        resource(322) of type (curl)
        ["headers":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
        NULL
      }
      ["headers":"DirkGroenen\Pinterest\Transport\Request":private]=>
      array(16) {
        [0]=>
        string(12) "HTTP/2 308 
"
        ["content-type"]=>
        string(24) "text/html; charset=utf-8"
        ["location"]=>
        string(39) "https://api.pinterest.com/v1/me/boards/"
        ["pinterest-generated-by"]=>
        string(27) "coreapp-ngapi-prod-0a01ca0a"
        ["x-envoy-upstream-service-time"]=>
        string(1) "4"
        ["vary"]=>
        string(15) "Accept-Encoding"
        ["content-encoding"]=>
        string(4) "gzip"
        ["cache-control"]=>
        string(7) "private"
        ["x-pinterest-rid"]=>
        string(16) "5894424023236689"
        ["content-length"]=>
        string(3) "245"
        ["date"]=>
        string(29) "Tue, 03 Mar 2020 15:19:13 GMT"
        ["set-cookie"]=>
        string(45) "_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure"
        ["x-cdn"]=>
        string(6) "akamai"
        ["age"]=>
        string(1) "0"
        [1]=>
        string(1) "
"
        [2]=>
        string(0) ""
      }
    }
    ["cachedEndpoints":"DirkGroenen\Pinterest\Pinterest":private]=>
    array(1) {
      ["users"]=>
      object(DirkGroenen\Pinterest\Endpoints\Users)#468 (2) {
        ["request":protected]=>
        object(DirkGroenen\Pinterest\Transport\Request)#465 (4) {
          ["host":"DirkGroenen\Pinterest\Transport\Request":private]=>
          string(29) "https://api.pinterest.com/v1/"
          ["access_token":protected]=>
          string(76) "ArZwzFt8O9jiDYUhKLO8rEmNsrMgFfjSvyKDD1dFRCaT5OBjfAlUgDAAAz4URpWg5i7gzNEAAAAA"
          ["curlbuilder":"DirkGroenen\Pinterest\Transport\Request":private]=>
          object(DirkGroenen\Pinterest\Utils\CurlBuilder)#464 (2) {
            ["curl":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
            resource(322) of type (curl)
            ["headers":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
            NULL
          }
          ["headers":"DirkGroenen\Pinterest\Transport\Request":private]=>
          array(16) {
            [0]=>
            string(12) "HTTP/2 308 
"
            ["content-type"]=>
            string(24) "text/html; charset=utf-8"
            ["location"]=>
            string(39) "https://api.pinterest.com/v1/me/boards/"
            ["pinterest-generated-by"]=>
            string(27) "coreapp-ngapi-prod-0a01ca0a"
            ["x-envoy-upstream-service-time"]=>
            string(1) "4"
            ["vary"]=>
            string(15) "Accept-Encoding"
            ["content-encoding"]=>
            string(4) "gzip"
            ["cache-control"]=>
            string(7) "private"
            ["x-pinterest-rid"]=>
            string(16) "5894424023236689"
            ["content-length"]=>
            string(3) "245"
            ["date"]=>
            string(29) "Tue, 03 Mar 2020 15:19:13 GMT"
            ["set-cookie"]=>
            string(45) "_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure"
            ["x-cdn"]=>
            string(6) "akamai"
            ["age"]=>
            string(1) "0"
            [1]=>
            string(1) "
"
            [2]=>
            string(0) ""
          }
        }
        ["master":protected]=>
        *RECURSION*
      }
    }
  }
  ["response":"DirkGroenen\Pinterest\Models\Collection":private]=>
  object(DirkGroenen\Pinterest\Transport\Response)#469 (2) {
    ["response":"DirkGroenen\Pinterest\Transport\Response":private]=>
    NULL
    ["curl":"DirkGroenen\Pinterest\Transport\Response":private]=>
    object(DirkGroenen\Pinterest\Utils\CurlBuilder)#467 (2) {
      ["curl":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
      resource(327) of type (Unknown)
      ["headers":"DirkGroenen\Pinterest\Utils\CurlBuilder":private]=>
      array(16) {
        [0]=>
        string(12) "HTTP/2 308 
"
        ["content-type"]=>
        string(24) "text/html; charset=utf-8"
        ["location"]=>
        string(39) "https://api.pinterest.com/v1/me/boards/"
        ["pinterest-generated-by"]=>
        string(27) "coreapp-ngapi-prod-0a01ca0a"
        ["x-envoy-upstream-service-time"]=>
        string(1) "4"
        ["vary"]=>
        string(15) "Accept-Encoding"
        ["content-encoding"]=>
        string(4) "gzip"
        ["cache-control"]=>
        string(7) "private"
        ["x-pinterest-rid"]=>
        string(16) "5894424023236689"
        ["content-length"]=>
        string(3) "245"
        ["date"]=>
        string(29) "Tue, 03 Mar 2020 15:19:13 GMT"
        ["set-cookie"]=>
        string(45) "_ir=0; Max-Age=1800; HttpOnly; Path=/; Secure"
        ["x-cdn"]=>
        string(6) "akamai"
        ["age"]=>
        string(1) "0"
        [1]=>
        string(1) "
"
        [2]=>
        string(0) ""
      }
    }
  }
}

Please responce asap

I don't see any error or issue with the response you're getting. The call returns a Collection instance which you can use to iterate through.

Please refer to the docs to read more about this class: https://github.com/dirkgroenen/Pinterest-API-PHP#collection

i have boards in my account but you can see there is not boards data in response that's the issue is