2016-07-26 47 views
2

我會按照Instagram的API嵌入登錄用戶的一些媒體:如何從Instagram API找到媒體的SHORTCODE或SHORTLINK?

https://api.instagram.com/oembed?url=http://instagr.am/p/fA9uwTtkSN/ 

但需要shortlink或至少簡碼生成的鏈接。不幸的是使用下面的API既不會返回短鏈接也不會縮短代碼。

https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN 

有沒有想法解決這個問題?

回答

1

在JSON API響應是有「鏈接」,那就是shortlink網址:

{ 
     "data": [{ 
      "comments": { 
       "count": 0 
      }, 
      "caption": { 
       "created_time": "1296710352", 
       "text": "Inside le truC#foodtruck", 
       "from": { 
        "username": "kevin", 
        "full_name": "Kevin Systrom", 
        "type": "user", 
        "id": "3" 
       }, 
       "id": "26621408" 
      }, 
      "likes": { 
       "count": 15 
      }, 
      "link": "http://instagr.am/p/BWrVZ/", 
      "user": { 
       "username": "kevin", 
       "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg", 
       "id": "3" 
      }, 
.... 
+0

謝謝您的回答,但對於使用嵌入API,必須考慮該帳戶不應該**私人的**。 – Mossen

+0

是的,如果您使用API​​獲取短鏈接,那麼您不必擔心,導致instagram不再通過API提供私人個人資料數據 – krisrak

相關問題