2016-06-02 27 views
2

私はログインしたユーザーのすべてのボードを持っており、pinterest APIを使用しています。私は与えられたボードからピンを取得できますが、jsonが返されたときにイメージリンクはありません。だから、どのようにしてイメージを取得するのoinコンテンツ。ここでjsonが取得されます。phpのpinterest apiを使ってピン画像を取得するには?

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イメージまたはメディアキーには値はありません。

答えて

0

「APIエクスプローラ」を使用し、「画像」フィールドを追加すると、出力の1つが元の画像のURLになります。

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

またはJS SDKを使用して、例えば:

PDK.request(thisRequest、{フィールド: 'ID、メモ、リンク、URL、画像'}、thisCmd、 関数(PDKdata){};

はここに私の例を参照してください:

Example of using Pinterest API

関連する問題