如何在php中使用pinterest api获取pin图像?

时间:2016-06-02 06:53:00

标签: php api pinterest

我拥有登录用户的所有主板并使用pinterest api我能够从给定的板上获取引脚但是当它返回json时没有图像链接,图像字段返回为null。那么如何使用oin内容获取图像。这是json检索的。

Array ( [data] => Array ( [0] => Array ( [id] => 400327854358866609 [link] => https://www.pinterest.com/r/pin/400327854358866609/4837342446222323658/8737cad9ec4b46439289fbd4f22353f02255549d33a8999691d82b8642f42625 [url] => https://www.pinterest.com/pin/400327854358866609/ [creator] => [board] => [created_at] => [note] => Hello this is simple test [color] => [counts] => [media] => [attribution] => [image] => [metadata] => [original_link] => ) [1] => Array ( [id] => 400327854358814014 [link] => https://www.pinterest.com/r/pin/400327854358814014/4837342446222323658/3f1103b8d1c97de21f913293ee6062f4122313c931b054764167e96745f64465 [url] => https://www.pinterest.com/pin/400327854358814014/ [creator] => [board] => [created_at] => [note] => 55 Awesome Men’s Tattoos | InkDoneRight We’ve collected 55 Awesome Different Mens Tattoo Designs to inspire you! We also have the meaning and symbolism behind the common men’s tattoo designs... [color] => [counts] => [media] => [attribution] => [image] => [metadata] => [original_link] => ) ) [page] => )  

在上面的json图像或媒体键中没有值。

1 个答案:

答案 0 :(得分:0)

如果您使用" API资源管理器",并添加"图像"字段,其中一个输出是原始图像的URL。

  

How do browsers analyze <tr> <td> without <table>?

或者使用JS SDK,例如:

  

PDK.request(thisRequest,{fields:&#39; id,note,link,url,image&#39;},thisCmd,   function(PDKdata){};

请参阅我的示例:

  

https://api.pinterest.com/v1/boards/BOARD_OWNER/BOARD_NAME/pins/?access_token=MY_TOKEN&fields=id%2Clink%2Cnote%2Curl%2Cattribution%2Cboard%2Ccolor%2Ccreated_at%2Ccreator%2Cimage%2Cmedia%2Cmetadata%2Coriginal_link%2Ccounts