MS Graph Rest API Errors - rest

I am getting the following errors for most of the resources in MS Graph.
Also the same resources are working fine with graph explorer ( https://graph.microsoft.io/en-us/graph-explorer ) using dummy tenant.
For POST /users
and PATCH /users
Status Code: 403
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "62c7e8f5-386a-4d15-8e94-5408d81b1383",
"date": "2017-01-24T09:08:46"
}
}
}
GET /drives
GET me/drive
Status Code: 500
{
"error": {
"code": "InternalServerError",
"message": "Unable to resolve template token",
"innerError": {
"request-id": "82ab9b86-7a90-4f86-877a-3ddb03ae1d71",
"date": "2017-01-24T09:12:35"
}
}
}
GET me/messages
GET me/events
GET me/mailFolders
GET me/contacts
Status Code: 504
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "678af389-cc38-4f5c-9b41-07595e62eee3",
"date": "2017-01-25T06:48:30"
}
}
}
Here is the list of scopes I have included.
"scope": "Calendars.Read Calendars.Read.Shared Calendars.ReadWrite Calendars.ReadWrite.Shared Contacts.Read Contacts.Read.Shared Contacts.ReadWrite Contacts.ReadWrite.Shared Directory.AccessAsUser.All Directory.Read.All Directory.ReadWrite.All email Files.Read Files.Read.All Files.Read.Selected Files.ReadWrite Files.ReadWrite.All Files.ReadWrite.AppFolder Files.ReadWrite.Selected Group.Read.All Group.ReadWrite.All IdentityRiskEvent.Read.All Mail.Read Mail.Read.Shared Mail.ReadWrite Mail.ReadWrite.Shared Mail.Send Mail.Send.Shared MailboxSettings.ReadWrite Notes.Create Notes.Read Notes.Read.All Notes.ReadWrite Notes.ReadWrite.All Notes.ReadWrite.CreatedByApp offline_access openid People.Read profile Sites.Read.All Tasks.Read Tasks.Read.Shared Tasks.ReadWrite Tasks.ReadWrite.Shared User.Read User.Read.All User.ReadBasic.All User.ReadWrite User.ReadWrite.All"

Related

How to get Facebook Page Conversation or Messages with the Graph API

what is the correct way to get the conversation/messages on a Facebook page?
I am using:
https://graph.facebook.com/v13.0/{page-id}/conversations which returns
{
"data": [
{
"id": "t_XXXX",
"updated_time": "2022-05-25T12:37:30+0000"
}
}
Now trying to get the messages with https://graph.facebook.com/v13.0/{page-id}/conversations/t_XXXX/messages throws
{
"error": {
"message": "Unknown path components: /messages",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "asdf"
}
}

Google People API updateContact, batchCreateContacts and batchUpdateContacts throwing Errors

The new Google People APIs
batchCreateContacts - https://developers.google.com/people/api/rest/v1/people/batchCreateContacts and batchUpdateContacts - https://developers.google.com/people/api/rest/v1/people/batchUpdateContacts gives following response on making a request.
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
updateContact - https://developers.google.com/people/api/rest/v1/people/updateContact gives the following response when CalendarUrl is sent in the update contact request
{
"error": {
"code": 400,
"message": "Invalid updatePersonFields mask path: \"calendar_urls\". Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/updateContact.",
"status": "INVALID_ARGUMENT"
}
}
Can someone help with these issues.

QuickBooksOnline API - Customer Balance API error - Permission Denied when other non reports API working

QuickBooksOnline API - Customer Balance is not working when other non reports API working with same access token
Request
https://sandbox-quickbooks.api.intuit.com/v3/company/123146076363264/reports/CustomerBalance?customer=1
Response
{
"Fault": {
"Error": [
{
"Message": "Permission Denied Error",
"Detail": "Permission Denied Error : You do not have the access rights to use this feature.",
"code": "5020",
"element": "ReportName"
}
],
"type": "ValidationFault"
},
"time": "2019-06-05T05:30:57.879-07:00"
}

Unable to get CPM data from Youtube Analytics account

I'm unable to get CPM data from my Youtube reports:
I'm getting:
{
"error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
]
}
}
I don't even know where to begin to debug this, and I haven't found anything online.
I'm just trying to curl the endpoint, mirroring this: HERE
Notice that once you finish the oauth process, User will see
"You do not have permission to execute this method." and the 403
Also, Notice if you remove 'CPM' from the list of metrics, this will work.
Example:
curl --header "Authorization: Bearer _____access_token____" -e "https://developers.google.com" https://content-youtubeanalytics.googleapis.com/v2/reports\?endDate\=2014-06-30\&ids\=channel%3D%3DMINE\&metrics\=cpm\&startDate\=2014-05-01\&key\=_____api_key____
I'm getting the refresh token via:
<script>
var auth2;
var SCOPE = ['https://www.googleapis.com/auth/adwords',
'https://www.googleapis.com/auth/yt-analytics.readonly',
'https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/yt-analytics-monetary.readonly',
'https://www.googleapis.com/auth/youtubepartner-channel-audit',
'https://www.googleapis.com/auth/youtubepartner',
'https://www.googleapis.com/auth/youtube.readonly',
] ;
function initClient() {
auth2 = gapi.auth2.init({
'clientId': 'my-client-id',
'scope': SCOPE.join(' '),
'prompt': 'consent',
})
}
function handleClientLoad() {
gapi.load('auth2', initClient);
}
</script>
<script async defer src="https://apis.google.com/js/api.js"
onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
</script>
the access token I'm using is from the refresh token via:
https://www.googleapis.com/oauth2/v4/token?client_id={my_client_id}&client_secret={my_client_secret}&refresh_token={my_refresh_token}&grant_type=refresh_token
and I'm getting:
{
"access_token": "ya29.GlvyBZVPpC.....",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/adwords https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/yt-analytics.readonly https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
"id_token": "eyJhbGciOiJSUz...."
}
I don't believe it's an issue with my scopes as I am not getting a 403 like:
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"errors": [
{
"message": "Request had insufficient authentication scopes.",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}

How to delete a facebook marketing lead form using graph api

According to the facebook documentation here Deleting a Lead Form
this is how you do it:
Send a delete http request to https://graph.facebook.com/v2.10/formId?access_token=the_access_token.
However I get the error below when I try the above:
{
"error": {
"message": "(#210) This call requires a Page access token.",
"type": "OAuthException",
"code": 210,
"fbtrace_id": "ABC123/xyz"
}
}
When I use a Page access token (as suggest by the error response) this is what I get:
{
"error": {
"message": "(#3) Subject must be on whitelist",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "IJK123/uvw"
}
}
If it matters the accessToken initially used is the same token used to create the leadform.
How can I get this to work? What am I missing?