facebookErrDomain code 3000 - facebook

Today I received of one of my app users a complaint about an error code 3000.
I could not find any information about this error, nor do I have a clue what caused this error, because i have no tracking in the app. Insights is reporting errors on fql.multiquery
I know the queries are fine, only 1 person out of hundreds have this problem at current time.
Did you had this error already or do you know what exactly this error means? As far as I can see there us no official error code list anymore, and copied existing lists do not cover this response code.

Well, I managed to get a full error report from facebook:
Error Domain=facebookErrDomain Code=3000 "The operation couldn’t be completed. (facebookErrDomain error 3000.)" UserInfo=0x5e08620 {request_args=(
{
key = method;
value = "fql.multiquery";
},
{
key = sdk;
value = ios;
},
{
key = queries;
value = "[...the queries...]";
},
{
key = "sdk_version";
value = 2;
},
{
key = "access_token";
value = "...";
},
{
key = format;
value = json;
}
), error_msg=Only administrators of applications, pages, and domains can retrieve Insights. The session user (100000XXXXXXXXX) does not own the object 132562XXXXXXXXX., error_code=3000}
There was one query accessing the page_fans metric from insights table. The user had only the "Tester" administration privilege associated. Changing the access level of the user to "Administrator" helped.
I changed my error report via UIAlertView to include the "error_msg" from the UserInfo, as it contains important indicators for user and me in case of a failure ;)
The answer for my question is:
You'll get an facebookErrDomain code 3000 error on graph api in case you do not have proper access rights for page or application insights data.

Related

Using Google.Cloud.ArtifactRegistry.V1Beta2 with parent - Permission problem

I wonder if anyone has used Google.Cloud.ArtifactRegistry.V1Beta2?
I am trying to create a console application with the api to list all Repositories in a project.
ListRepositoriesRequest request = new ListRepositoriesRequest
{
Parent = "",
PageSize = 1
};
var response = client.ListRepositories( request );
I have no indication what parent should be. The help just says "The name of the parent resource whose repositories will be listed". I have tried project name, project id but nothing works. I get the error "Permission denied" and I have full access as I am the owner of the project. Being lost what could be wrong, I suspect it could be the parent or does anyone has any idea where to look?
Sometimes the docs are not very clear but this one is very clear. If you look closer to the section HTTP request you will find
GET https://artifactregistry.googleapis.com/v1beta2/{parent=projects/*/locations/*}/repositories
So the parent is:
{parent=projects/*/locations/*} -> projects/*/locations/*
So, if you want to list repositories in us-central1 for example, your parent will be:
ListRepositoriesRequest request = new ListRepositoriesRequest
{
Parent = "projects/YOUR_PROJECT_ID/locations/us-central1",
PageSize = 1
};
var response = client.ListRepositories( request );
So my advice is to inspect very well the docs.

Service Account for google sheets returns not found

I am trying to read a spreadsheet using a service account (I cannot use OAuth, which works, since the process will be running on a server to periodically check sheet data)
I tried several approaches. If I follow the example using oauth I can see the sheet values. However, I need the run the script without any GUI on the background.
I have found this tutorial https://github.com/juampynr/google-spreadsheet-reader
I have created a projec, service account, added viewer role, shared the spreadsheet with the service account email. Generated the key.
It seems that the test program can connect to the google services but the moment it request the spreadsheet the end result is "404 not found".
require 'vendor/autoload.php';
$service_account_file = '/secrets/readsheetmar2019-08b737d1c1cb._portfolio_test.json';
$spreadsheet_id = '1TAWybckPrnWlQxBZh0ScDsFOvftwi2dvTBNGarSdY30';
$spreadsheet_range = '';
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . $service_account_file);
$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(Google_Service_Sheets::SPREADSHEETS_READONLY);
$client->fetchAccessTokenWithAssertion();
$service = new Google_Service_Sheets($client);
//added by me
if ($client->isAccessTokenExpired()) {
print "expired\n";
}else{
print "not expired\n";
}
$result = $service->spreadsheets_values->get($spreadsheet_id, $spreadsheet_range);
var_dump($result->getValues());
Error:PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message '
Error 404 (Not Found)!!1
When the access token retrieved by OAuth2 is used, the Spreadsheet of $spreadsheet_id = '1TAWybckPrnWlQxBZh0ScDsFOvftwi2dvTBNGarSdY30'; can retrieve the values.
When the access token retrieved by Service Account is used, Error 404 (Not Found)!!1 is returned.
If my understanding is correct, please confirm the following points.
Confirmation points:
As a test run, please set the range $spreadsheet_range = '';.
For example, it's $spreadsheet_range = 'Sheet1'.
If the error message of The caller does not have permission is returned, please confirm as follows.
Whether the Spreadsheet of 1TAWybckPrnWlQxBZh0ScDsFOvftwi2dvTBNGarSdY30 is sharing the email of Service Account.
If you didn't share the Service Account to the Spreadsheet, please share the email of client_email in the file of readsheetmar2019-08b737d1c1cb._portfolio_test.json to the Spreadsheet you want to access.
If the error message of Google Sheets API has not been used in project ### before or it is disabled. is returned, please enable Sheets API.
If this was not the solution for your issue, I apologize.

Facebook Marketing API - Object with ID does not exist

I started with Facebook Marketing API today.
I am simply trying to read the campaigns from my Facebook Business account. I have an Ad account and a Campaign created there.
I suppose my issue is with generating the Token.
I am simply generating the token from here: https://developers.facebook.com/tools/explorer?classic=0
And the error I get is:
{ error:
{ message: 'Unsupported get request. Object with ID \'10xxxxxxxx\' 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: 'E5CAU6UvHwF' } }
My Node.js code is:
const readCampaign = async (program) => {
const accessToken = TOKEN
const api = adsSdk.FacebookAdsApi.init(accessToken)
const account = new AdAccount('act_' + program.accountid)
console.log('act_' + account.id) // fields can be accessed as properties
let result
account.read([AdAccount.Fields.name])
.then((account) => {
return account.getCampaigns([Campaign.Fields.name], { limit: 10 }) // fields array and params
})
.then((result) => {
campaigns = result
campaigns.forEach((campaign) => console.log(campaign.name))
}).catch(console.error);
console.log(result)
}
To generate the Token I am choosing the App I created, "Get User Access Token" and then selected all possible permissions there - just to test this.
What am I doing wrong? Thanks
I suspecting this is due to a permission error.
First I would check that your app has access to the account you are trying to access.
Then I would suggest creating a system user through your business manager (can be found under business settings ), assigning it access to ad accounts, and utilizing the the system user's token when initializing the library.
One big advantage is that the system users's token does not have such a short expiration time.
Facebook system user doc

How to access Facebook Analytics data using the marketing API?

I'm creating an app that needs to display Facebook marketing data such as insights, cpm, etc on various pages and posts associated with an account. I haven't been able to figure it out so far. I've created an app, and have tried making calls from the sandbox account with the appropriate access token. When running the demo code to read the ad account's name and age I am getting the following error. This has been really frustrating and my employer is getting mad. Any help is appreciated.
Code (node.js):
const adsSdk = require('facebook-nodejs-ads-sdk');
const accessToken = 'Sandbox acct token';
const api = adsSdk.FacebookAdsApi.init(accessToken);
const AdAccount = adsSdk.AdAccount;
const account = new AdAccount(XX Sandbox ID XX);
console.log(account.id)
account
.read([AdAccount.Fields.name, AdAccount.Fields.age])
.then((account) => {
logPassedTest(test1 + ':Pass', account);
})
.catch((error) => {
console.log(error);
});
Error:
message: 'Unsupported get request. Object with ID \'XXX\' 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',
{ error:
{ message: 'Unsupported get request. Object with ID \'XXX\' 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: 'ACp+q8Bas3Z' } },
method: 'GET',
url: 'https://graph.facebook.com/v2.11/X?fields=name%2Cage&access_token=XX',
data: {} }
The AdAccount ID is prefixed with act_
i.e. act_<ACCOUNT_ID>.
There is really no way of debugging this. The error code likely means you are providing the wrong object to the call you are making.
Go to: https://developers.facebook.com/tools/explorer/
Plug in your access token and the exact call you are making. If the call fails, remove pieces of it until it succeeds.

Workday: Put_Customer returning an error

We are using Snaplogic to load records into workday. Currently, extracting customer records from the source and trying to load them into workday using the object Put_Customer of web service Revenue_Management.
I was getting the following error:
But I'm not getting any category information from the source. So, I tried putting the value for Customer_Category_Reference as 1. But I ended up getting the following error.
The documentation for workday is not helpful and this has been a blocker for me for some time now.
Any help will be appreciated.
Update:
Trying to get customer categories using the Get_Customer_Categories object of Revenue_Management web service using Snaplogic. But getting the following error:
Failure: Soap fault, Reason: Processing error occurred. The task submitted is not authorized., Resolution: Address SOAP fault message and retry
Unfortunately I don't have access to a tenant at this time to validate . However it is likely to work based in prior experience . Perhaps you could create a customer in Workday, through the GUI. Then do get customer API call. Note the category reference . Then, use that in your put customer call
If you look at the API documentation, you will find that Put_Customer accepts a WID in the Customer_WWS_Data object. If you search for "Customer Categories" in Workday, you will likely find the report of the same name. Just select the category that you want your newly loaded customers to default to (click on the magnifying class, then on the ellipsis, Integration Ids, View Ids). The Workday ID will appear at the top.
I have not used the Revenue Management API, but my code for creating a position reference in the Compensation API is probably very similar to what you need to do for the Customer Category reference:
public static Position_ElementObjectType getPositionReference(string WID) {
return new Position_ElementObjectType {
ID = new Position_ElementObjectIDType[] {
new Position_ElementObjectIDType {
type = "WID",
Value = WID
}
}
};
}