如何从Instagram API中找到媒体的SHORTCODE或SHORTLINK?

时间:2016-07-26 06:37:56

标签: php instagram instagram-api

我将通过关注Instagram API嵌入一些登录用户的媒体:

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

但它需要短链接或至少短代码才能生成链接。不幸的是,使用以下API既不返回短链接也不返回短代码。

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

有什么想法解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

在JSON API响应中,有一个"链接" ,即短链接网址:

    {
        "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"
            },
....