Posts tagged with facebook-graph-api

Facebook phone app itself has a shop when you go to a specific business page. I am helping my company to collect the price of the products listed daily on the meta shop, and I already found the shop ID. The documentation below is the only part that shows API for shop, but do not find any information about product listing and price? Am I in the right direction for API endpoint? I used catalog ID previously and it collected the wrong pricing data.

https://developers.facebook.com/docs/commerce-platform/catalog/shop#get--read-api-

I am using instagram graph api, with these permissions(pages_show_list, instagram_basic, pages_read_engagement) and this repository https://github.com/jstolpe/instagram-graph-api-php-sdk

I am able to obtain a long-lived access token and use it to retrieve media and perform other actions, but the token expires after 60 days. I’m looking for a way to refresh it before it expires.

I found this https://developers.facebook.com/docs/instagram-platform/reference/refresh_access_token but when I try this code

GET https://graph.instagram.com/refresh_access_token   ?grant_type=ig_refresh_token   &access_token={long-lived-access-token} 

the output is: "Sorry, this content isn't available right now"

Is there a way to automatically refresh a long-lived access token, or does it need to be manually updated every 59 days?

Additionally, I can’t find any information on how to obtain or add the instagram_graph_user_profile permission.

Does anyone know how to resolve this?

I apologize if my question is not strictly about a code issue, but I’m not sure where else to ask for help.

Using the WhatsApp Business API, I can create a catalog and have it displayed in the header of the WhatsApp Business number.

I can also upload products via the API, and these products do appear in the Commerce Manager catalog. However, they remain in the status ‘Item will be reviewed — This item will be reviewed before it can appear in ads or Shops to make sure it complies with our policies. If you've chosen to show this item anywhere, it'll automatically appear once it is approved. We'll let you know if there are any issues.’ for a very long time, sometimes days. And after all this time, they're still stuck in this status.

Below is a small PHP snippet I use to build the array that gets sent to Facebook’s endpoint for product creation, but that’s the only code involved. I haven’t received any notifications about policy compliance issues or anything else that might explain the delay.

$data = [     "name" => $name,     "currency" => "EUR",     "price" => $price,     "image_url" => $image_url,     "retailer_id" => $retailer_id,     "description" => $description,     "url" => $url,     "brand" => $brand ]; $headers = [     "Authorization: Bearer {$auth_token}",     'Content-Type: application/json' ]; POST https://graph.facebook.com/v17.0/<$catalog_id>/products 

I can assure you that all variables are defined, because even in the product detail window, all the data sent via POST is displayed.

Unfortunately, the only link I have to contact Facebook Business Support leads to a page that doesn’t help at all.

I’m wondering if this is a common issue people are currently facing. I’m not sure what else to try at this point.

Thank you for any help you can give me.

{ "name": "ewf", "adset_id": "120215374042820542", "creative": { "creative_id": "1336302651052048" }, "status": "ACTIVE", "leadgen_form_id": "3944213285856717", "access_token": "EAARyZAITtz6QBO86pyaorCyAa5uij334AFiVizvoL5rnw65FBlnqWQJydGUhd1L6fgfIHmxuNyz2lba3xGj6Y8c1jZCvZBkrZA4sVvoImjNpfBdJrELvylBr8lNm5MpBKrzP7dg9FzLULbt9taTUjxge63my0RhvdKxdHS3BZAsUrbMn8AcJmeBePLZAFcZBGfGIwZDZD" }

Running into a unique issue here regarding Meta Graph API Webhooks, specifically for click-to-message ads. This is specific to click to message conversations - the app works perfectly for conversations initiated organically. The setup:

The user token used to generate the page access token has the following permissions: pages_show_list, ads_management, ads_read, business_management, pages_messaging, leads_retrieval, pages_read_engagement, pages_manage_metadata, pages_read_user_content, pages_manage_ads, pages_manage_posts, pages_manage_engagement, public_profile

The page access token generated via this user token has the following permissions: pages_show_list, ads_management, ads_read, business_management, pages_messaging, leads_retrieval, pages_read_engagement, pages_manage_metadata, pages_read_user_content, pages_manage_ads, pages_manage_posts, pages_manage_engagement, public_profile

The Meta application is subscribed to the following web hook fields feed, leaden, message_echoes, messages, messaging referrals

This setup works perfectly for messenger conversations that start organically. However, no message data is received via the web hook for those initiated via an advertisement (click to message). Only the 'referral': {'source': 'ADS', 'type': 'OPEN_THREAD'... web hook is sent, which has no details on the message itself. The same goes for outgoing messages in these threads - no web hook is sent for messaging_echoes.

The only workaround I currently have found that resolves this issue is to assign my personal Facebook account full admin (Everything) access directly at the page level or via the Business Manager that directly owns the Facebook page. Webhooks start firing for click to message ads once this is done.

However, if I am assigned full admin (Everything) access to the page through a partner Business Manager, the webhooks for click to message ads do not fire for click to message ads. They do fire for organic messenger threads.

Is anybody aware of a possible solution here?