The caller does not have permission. Google Adsense Management Api - adsense-api

{ "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
It says you don't have permission. But I am logging in oauth2 with the adsense account itself. So it's not from a different account. It seems silly to me that there is an access permission issue here. I couldn't get past this error for about 1 day.
By the way, I get the same result in google's 'try this method' service.
SOLVED
I was entering the adsense email as the accounts parameter, the problem was here. API worked when using account name

Related

Access denied issue for Microsoft graph api

When I share excel url with personal one drive account and doing get request of URL details with office account token I have an issue when using shared url from personal drive which has the format
https://1drv.ms/x/s!{token}
or
https://onedrive.live.com/view.aspx?resid=B4FDB33875A82&ithint=file%2cxlsx&authkey=!EKQJrE3T5A
Permissions Scopes I have given as per documentation
Request :
GET https://graph.microsoft.com/v1.0/shares/{shareIdOrEncodedSharingUrl}/driveItem
Response :
{
"error": {
"code": "accessDenied",
"message": "The sharing link no longer exists, or you do not have permission to access it.",
"innerError": {
"date": "2022-06-29T12:49:15",
"request-id": "e1e9f673-1b66-49f3-8abd-70a1240f5442",
"client-request-id": "e1e9f673-1b66-49f3-8abd-70a1240f5442"
}
}
}

Search for sites returns 403 Access Denied

We've seen a change in functionality with the Microsoft Graph /sites?search endpoint.
Within the past couple of days, when making this call:
https://graph.microsoft.com/v1.0/sites?search=
for certain tenants, we now receive:
{
"error": {
"code": "accessDenied",
"message": "The caller does not have permission to perform the action.",
"innerError": {
"request-id": "a37ae18e-dcd2-481d-bb06-0a0f5cade4f4",
"date": "2018-09-28T13:54:56"
}
}
}
We are using app only authentication with the following roles:
"roles": [
"Directory.Read.All",
"User.Read.All"
],
Has there been a change in permissions required for this call?
According to the documentation, you need either Sites.Read.All or Sites.ReadWrite.All in order to use /sites?search={query}.

Graph API encounter 400 failed to get drive in china

Before a day, the operation works fine.
https://microsoftgraph.chinacloudapi.cn/v1.0/users/{user_id}/drives
Suddenly, it keeps encounter this error:
{
"error": {
"code": "BadRequest",
"message": "Unable to retrieve user's mysite URL.",
"innerError": {
"request-id": "d50647af-33c2-4503-a6c1-eb046173108c",
"date": "2018-04-03T08:33:58"
}
}
}
I have checked the subscription and APP permission in graph API, all permission is enabled
And I have tested another APP using the same graph API permission which works fine.
Do not know what going wrong here
Thanks you.

Regarding azure login to different resources

Currently i'm authenticating to a resource one which is my backend. But using the same access token i tried to get data from Microsoft graph api it's giving
{
"odata.error": {
"code": "Authentication_MissingOrMalformed",
"message": {
"lang": "en",
"value": "Access Token missing or malformed."
},
"date": "2018-02-22T10:37:53",
"requestId": "381cf386-6065-422b-b561-164ed17dcfdf",
"values": null
}
}
How to resolve this. Is it possible to access both with one access token
No. An access token is always meant for one API/resource.
You must get two access tokens. You can use the refresh token or authorization code to get two.

Microsoft Graph InTune Beta API's - Unable to add app to app policy

I am attempting to use Intune specific beta Graph APIs to assign apps to an iOS managed app protection policy. I am able to create the app policies using the endpoint documented below:
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_iosmanagedappprotection_create
When created via API, the app "deployedCount" is 0 until specific apps are added in the admin console UI.
Now, I am attempting to retrieve apps added to any policy by API using the endpoint documented below.
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_list
I get a 400 bad request response that appears to say this endpoint either does not exist or is not responding correctly. This seems unlike if I mistyped an endpoint.
Response I receive:
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/entityset/key/navigation with http verb GET for request /MAMAdmin/MAMAdminFEService/managedAppPolicies('T_338de6df-386d-4f1b-a51c-a0d189c61722')/mobileAppIdentifierDeployments.",
"innerError": {
"request-id": "79514f29-4dca-48a5-a2de-5d14138577d7",
"date": "2017-02-08T17:46:52"
}
}
}
Response if I mistyped:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'asdfasdf'.",
"innerError": {
"request-id": "e86d84ab-f062-4780-af3c-9afae6e7bc82",
"date": "2017-02-08T18:53:29"
}
}
}
Hello this is Alemeshet Alemu from MSFT.
Sorry, the API documentation is a bit out sync. Could you try with $expand?
GET /managedAppPolicies/{managedAppPoliciesId}?$expand=mobileAppIdentifierDeployments
Alemeshet Alemu (MSFT)

Resources