{"id":509,"date":"2023-01-02T21:42:40","date_gmt":"2023-01-03T03:42:40","guid":{"rendered":"https:\/\/justinstolpe.com\/blog\/?p=509"},"modified":"2023-01-03T21:01:05","modified_gmt":"2023-01-04T03:01:05","slug":"get-a-facebook-pages-instagram-business-account","status":"publish","type":"post","link":"https:\/\/justinstolpe.com\/blog\/2023\/01\/02\/get-a-facebook-pages-instagram-business-account\/","title":{"rendered":"Get Users Facebook Pages | Instagram Graph API PHP SDK"},"content":{"rendered":"<p><center><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/n43JIBAVu44\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center><br \/>\nTo get an Facebook Page&#8217;s Instagram Business Account with the <a href=\"https:\/\/github.com\/jstolpe\/instagram-graph-api-php-sdk\/tree\/main\/src\/Instagram\" target=\"_blank\" rel=\"noopener\">Instagram Graph API PHP SDK<\/a>, you have to use the users access token and make a request to the pages endpoint on the Instagram graph API.<\/p>\n<h3><strong>Get User Facebook Pages<\/strong><\/h3>\n<pre>use Instagram\\User\\User;\r\n\r\n$config = array( \/\/ instantiation config params\r\n    'access_token' =&gt; 'ACCESS_TOKEN',\r\n);\r\n\r\n\/\/ instantiate and get the users info\r\n$user = new User( $config );\r\n\r\n\/\/ get the users pages\r\n$pages = $user-&gt;getUserPages();\r\n<\/pre>\n<p>And that is all you need to do! The Instagram Graph API PHP SDK takes care of all the heavy lifting for you! I know the Instagram Graph API can be a bit confusing and so I hope this makes dealing with it a bit easier! Well, that is going to do it for this post! Leave any comments\/questions below and thanks for stopping by the blog!<\/p>\n<p style=\"text-align: center;\"><strong>Links<\/strong><\/p>\n<p><strong><a href=\"https:\/\/github.com\/jstolpe\/instagram-graph-api-php-sdk\" target=\"_blank\" rel=\"noopener\">Code on GitHub<\/a><\/strong><\/p>\n<p><strong><a href=\"https:\/\/github.com\/jstolpe\/instagram-graph-api-php-sdk\/wiki\" target=\"_blank\" rel=\"noopener\">Wiki on GitHub<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=n43JIBAVu44\" target=\"_blank\" rel=\"noopener\"><strong>YouTube Video<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To get an Facebook Page&#8217;s Instagram Business Account with the Instagram Graph API PHP SDK, you have to use the users access token and make a request to the pages endpoint on the Instagram graph API. Get User Facebook Pages use Instagram\\User\\User; $config = array( \/\/ instantiation config params &#8216;access_token&#8217; =&gt; &#8216;ACCESS_TOKEN&#8217;, ); \/\/ instantiate &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/justinstolpe.com\/blog\/2023\/01\/02\/get-a-facebook-pages-instagram-business-account\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Get Users Facebook Pages | Instagram Graph API PHP SDK&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":518,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,9],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","category-php"],"_links":{"self":[{"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":6,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions\/519"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/media\/518"}],"wp:attachment":[{"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justinstolpe.com\/blog\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}