I'm unable to get a list of my campaigns using Facebook Graph API
Response for /me/adaccounts
{
"data": [
{
"account_id": "123456789000001234",
"id": "act_123456789000001234"
}
],
"paging": {
"cursors": {
"before": "AAAAaaaBBBBcccc",
"after": "AAAAaaaBBBBdddd"
}
}
}
/123456789000001234/campaigns returns
{
"error": {
"message": "Unsupported get request. Object with ID '123456789000001234' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "EilRrOk1CEb"
}
}
Note that id's have been changed to dummy-values.
The token is for a system user and the ad account have been assigned to the user (role: admin). Token contains following scopes: read_page_mailboxes, rsvp_event, ads_management, ads_read, read_insights, manage_pages, publish_pages, pages_show_list, pages_manage_cta, pages_manage_instant_articles, business_management, publish_actions
What am I doing wrong?
Had to use id: act_123456789000001234 instead of account_id: 123456789000001234 so the request becomes /act_123456789000001234/campaigns. Also had to create a Facebook App, add Marketing API and assign to that an Ad Account, then create a token via the app instead of creating a token from the Business Manager.
Related
I am trying to refresh a PBI Data Flow using an ADF web activity by authenticating using the data factory's Managed Identity.
Here is my input to the activity:
{
"url": "https://api.powerbi.com/v1.0/myorg/groups/1dec5b21-ba60-409b-80cb-de61272ee504/dataflows/0e256da2-8823-498c-b779-3e7a7568137f/refreshes",
"connectVia": {
"referenceName": "My-AzureVM-IR",
"type": "IntegrationRuntimeReference"
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"User-Agent": "AzureDataFactoryV2",
"Host": "api.powerbi.com",
"Accept": "*/*",
"Connection": "keep-alive"
},
"body": "{\"notifyOption\":\"MailOnFailure\"}",
"disableCertValidation": true,
"authentication": {
"type": "MSI",
"resource": "https://analysis.windows.net/powerbi/api"
}
}
It generates the following error when doing a debug run:
Failure type: User configuration issue
Details: {"error":{"code":"InvalidRequest","message":"Unexpected dataflow error: "}}
I have tried this exact URL in Postman using Bearer Token Authentication and it works. Our AAD Admin group said they added our ADF's Managed Identity to the permission list for the PBI API, so I am not sure what is going on here.
Just an FYI, I was able to get the ADF Managed Identity working with data flow refreshes using the HTTP request in my original post.
The key was after having the Tenant Admins add the Managed Identity to a security group with API access, I then also had to add the Managed Identity to the PBI Workspace access list as a Member.
Then my API call worked from ADF using the MSI. No Bearer login token needed.
I trying to call to overlap api via facebook graph api
The only source I find to facebook overlap is here
Facebook Audience Overlap via API
But when I trying it really not work
The call is in api v10.0
act_10202169727663069/audienceoverlap?pivot_id=6124596383156&{comparison_ids=["6124720495756","6122310977756"]}
The answer I get is:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (audienceoverlap) on node type (AdAccount)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Avf-Fn29XQoHMU3bAxGNQBc"
}
}
Debug information
==== Query
curl -i -X GET \
"https://graph.facebook.com/v10.0/act_10202169727663069/audienceoverlap?pivot_id=6124596383156&%7Bcomparison_ids=%5B%226124720495756%22%2C%226122310977756%22%5D%7D&access_token=<access token sanitized>"
==== Access Token Info
{
"perms": [
"read_insights",
"ads_management",
"ads_read",
"business_management",
"pages_manage_ads",
"public_profile"
],
"user_id": "10224770822076304",
"app_id": 987735165367365
}
==== Parameters
- Query Parameters
{
"pivot_id": "6124596383156",
"{comparison_ids": "[\"6124720495756\",\"6122310977756\"]}"
}
- POST Parameters
{}
==== Response
{
"error": {
"message": "(#100) Tried accessing nonexisting field (audienceoverlap) on node type (AdAccount)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Avf-Fn29XQoHMU3bAxGNQBc"
}
}
==== Debug Information from Graph API Explorer
- https://developers.facebook.com/tools/explorer?method=GET&path=act_10202169727663069%2Faudienceoverlap%3Fpivot_id%3D6124596383156%26%7Bcomparison_ids%3D[%226124720495756%22%2C%226122310977756%22]%7D&version=v10.0
I'm trying to consume this API:https://developers.google.com/admin-sdk/directory/v1/reference/resources/buildings/list?authuser=2
scopes are ok, and also I can get correctly the Token
When I try to list the buildings, this error appears, as API Response body:
[Google_Service_Exception (404)]
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Domain not found."
}
],
"code": 404,
"message": "Domain not found."
}
}
What can it be?
What did you enter on "customer" usually the "my_customer" alias works instead of the domain, it should return something like this with a 200ok.
{
"kind": "admin#directory#resources#buildings#buildingsList",
"etag": "\"zPBZh0CqI7H8js2356iu34gfr/vp6Pfh5j7RvsFk64fdf3eyIC8\"",
"buildings": []
}
Keep in mind that the Admin SDK must be used with a Super Admin of a G Suite account, it cannot be used with consumer gmail accounts. The "Domain not found." is generated when the Admin SDK is executed with a gmail account, check what account you are logged in.
Sometimes there is a problem when you login with different accounts to the browser window. In case of chrome you can have multiple profiles https://support.google.com/chrome/answer/2364824?co=GENIE.Platform%3DDesktop&hl=en that way it will not share cookies and cache since that is usually the problem when using the "Try this API" from Google APIs.
I hope this helps. Greetings.
I am trying to get comments for some business account by using business discovery node. I can load list of media with the request
GET
https://graph.facebook.com/v3.1/17841402914723639?fields=business_discovery.username(bluebottle){followers_count,media_count,media{media_type,comments_count}}
This returns
{
"business_discovery": {
"followers_count": 297515,
"media_count": 1317,
"media": {
"data": [
{
"media_type": "IMAGE",
"comments_count": 18,
"id": "17970528943031455"
},
{
"media_type": "IMAGE",
"comments_count": 17,
"id": "17938949563163035"
},
{
"media_type": "IMAGE",
"comments_count": 66,
"id": "17966264041064104"
},
I assume the id in the media entry is an id for that object. But when I am trying to access it like
GET https://graph.facebook.com/v3.1/17970528943031455
I got an error
{
"error": {
"message": "Unsupported get request. Object with ID '17970528943031455' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "HbaasWNQ8ko"
}
}
Is it permission problem?
How can I get list of comments for a media?
According to the documentation: "An access token from a User who created the IG Media object, with the following permissions:" means that you need to have access permission granted by the owner of the post to have access to its comments.
The syntax of the query is :
business-account-id?fields=business_discovery.username(bluebottle){media{comments}}
But when I tried that I got this error :
{
"error": {
"message": "(#100) Please read documentation for supported fields.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "BFuJQt0/Kt3"
}
}
So I'm guessing they have removed the support for fetching the comments.
You can only get comments if you have a valid authentication token for the account you are querying. You would use the /media or <media_id>/comments endpoint to get comments, insights, etc:
Media endpoint
/MY_IG_BUSINESS_ACCOUNT_ID/media?fields=id,caption,comments_count,children{media_url},comments.limit(50){id,timestamp,username,text},insights.metric(impressions,reach,engagement,saved,video_views)&limit=30
Comments endpoint:
/<MEDIA_ID>/comments/?fields=created_time,from,message,like_count&limit=50
I have application that communicate with WSO2AM 2.1.0 using their Restful API.
Right now I'm working on the application subscription part, I need to create a feature that able to refresh accessToken, it's the keys[0].token.accessToken from json below.
GET https://localhost:9443/api/am/store/v0.11/applications/896658a0-b4ee-4535-bbfa-806c894a4015
Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8
HTTP/1.1 200 OK
Content-Type: application/json
{
"groupId": "",
"callbackUrl": null,
"subscriber": "admin",
"throttlingTier": "Unlimited",
"applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015",
"description": null,
"status": "APPROVED",
"name": "DefaultApplication",
"keys": [ {
"consumerKey": "AVoREWiB16kY_GTIzscl40GYYZQa",
"consumerSecret": "KXQxmS8W3xDvvJH4AfR6xrhKIeIa",
"keyState": "COMPLETED",
"keyType": "PRODUCTION",
"supportedGrantTypes": null,
"token": {
"validityTime": 3600,
"accessToken": "3887da6d111f0429c6dff47a46e87209",
"tokenScopes": [
"am_application_scope",
"default"
]
}
}]
}
I ended up reading this documentation https://docs.wso2.com/display/AM210/Token+API and I think that is not the documentation I'm searching for. The token API there is used to refresh the access token to the WSO2, not for refreshing the application subscribtion token.
Is there any way to do this?
Store API uses client-credential grant type to generate an access token. That is why you don't get the refresh token in the response. You can do the following.
Used the API - https://docs.wso2.com/display/AM210/apidocs/store/
Create an application in APIM Store. (/applications)
Get consumerKey and consumer secret of the application by generating the keys. (/applications/generate-keys)
Use the password grant type and generate a token. https://docs.wso2.com/display/AM210/Password+Grant