小编Mit*_*thc的帖子

Instagram Graph API: Media Thumbnail URL

I'm using the Instagram Graph API in a business account, and almost everything works just fine. I have created a WordPress port of the Facebook SDK, and the function that retrieves the media items looks like this (part of a class, the $fb object is already authenticated using the default_access_token in the class constructor):

public function get_media( $business_account_id = '', $limit = 15 ) {
    $limit = absint( $limit );

    try {
        $response = $this->fb->get( "/{$business_account_id}?fields=media.limit({$limit}){media_url,caption,thumbnail_url,permalink}" );
        return $response->getDecodedBody();
    } …
Run Code Online (Sandbox Code Playgroud)

facebook-graph-api facebook-php-sdk instagram-api

3
推荐指数
1
解决办法
1703
查看次数