Getting error code 200 for google assistant on Raspberry pi 3 - google-assistant-sdk

I am getting the following errors:
https://embeddedassistant.googleapis.com/v1alpha2/projects/rpiassistant-f01c3/devices/B65EF05D34859770BDEBF646E84D89F1 200
ON_MUTED_CHANGED:
{'is_muted': False}
ON_START_FINISHED
[2509:2526:ERROR:http_client_with_backoff.cc(113)] Retrying request with http_status=200 request_id=0
The above URL returned as follows:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}
Please note that I have enabled the API still getting this error please help

HTTP status code 200 is not an error. Rather, it is an indication that the HTTP request was successful.
When the sample is making that call, it includes authorization that tells the Google Assistant SDK server that it is you making this request. When you just open it up in a browser, the server doesn't know it is you and returns a 403 for unauthorized access.
AFAIK, this is working as intended and you should be able to run the sample without issue.

Related

YouTube Data API - Members: list Code 403

The request https://www.googleapis.com/youtube/v3/members fails with code 403 "Access forbidden. The request may not be properly authorized." even in the Google OAuth 2.0 Playground while all other requests succeed. Does that mean I am missing the approval from YouTube? I have completed the forms to request the approval several weeks ago, but I have yet to get any response from YouTube.
API request with parameters used
https://youtube.googleapis.com/youtube/v3/members?part=snippet
Result
{
"code" : 403,
"errors" : [ {
"domain" : "youtube.common",
"message" : "Access forbidden. The request may not be properly authorized.",
"reason" : "forbidden"
} ],
"message" : "Access forbidden. The request may not be properly authorized."
}
Expected result
Response body with Members List
Is it 100% reproducible?
Yes
Reproducible API explorer link
https://developers.google.com/oauthplayground/
approval
If you check the top of the page for
members.list you will see that this method has been replaced by sponsors.list
So calling Members.list isnt going to work. You ened to call sponsors.list and you need permission from google inorder to call that
authorization
Assuming you have summited the form and requested access to the new sponsors.list method and have been granted access you should know that calling memebers.list wont work. As its been deprecated you need to call sposors.list and it needs to be authorized. I would guess with the same scope as before.
The message is telling you that you have summited the request without being properly authorized to access the data.
Access forbidden. The request may not be properly authorized.
You need an access token sent as an authorization header before you will be able to make that call please check authorization
As this new method isn't documented I would have to guess it would be something like this.
GET https://youtube.googleapis.com/youtube/v3/sponsors?part=snippet?key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
If you have been granted access to this method then you might have an email contact at google that you can ask what the actual call is if its not working.

Insert liveCuePoints in live broadcast - getting error 403 Forbidden

We have a verified app with the following scopes:
https://www.googleapis.com/auth/youtube.force-ssl
https://www.googleapis.com/auth/youtubepartner
https://www.googleapis.com/auth/youtube
This means we can use the YouTube Data API and YouTube Content ID API (for YouTube Partners).
We are trying to do ad inserts (insert LiveCuepoints) for a live broadcast on a YouTube partner channel, which is connected via our verified app. We are getting the following error when we use the LiveCuepoint insert API endpoint:
Request
POST /youtube/partner/v1/liveCuepoints?channelId={channelId}&onBehalfOfContentOwner={contentOwnerId} HTTP/1.1
Authorization: Bearer {accessToken}
Content-Type: application/json; charset=utf-8
Host: www.googleapis.com
Content-Length: 57
{"broadcastId":"{broadcastId}","settings":{"cueType":"ad"}}
Response
{
"error": {
"code": 403,
"message": "Forbidden",
"errors": [
{
"message": "Forbidden",
"domain": "global",
"reason": "forbidden"
}
]
}
}
Other requests (with the same credentials) to the YouTube Content ID API (such as listing contentOwners or listing liveBroadcasts) are working fine and without errors.
We’ve tried debugging this issue for many hours, researched online and tried different solutions but couldn’t get this to work. Is there a special scope, setting or access needed to do ad inserts in a live broadcast? Is anyone having working example code to do liveCuepoint inserts?
For anyone interested: I found the solution.
We connected (via our verified app) as a channel. This was a mistake, you have to authenticate with an account, and this account must have administrator rights.
Now you receive an access token which can access all content owners and channels connected to that account. Inserting liveCuePoints now works fine!

Getting "invalid platform app" while trying to retrieve authorization code on Instagram

I'm trying to get an authorization code to exchange for a user access token to gain access to the Instagram Basic Graph API. I've followed the directions on the Facebook Developer Page and am stuck on authenticating the user. I've tried loading the authorization uri:
https://api.instagram.com/oauth/authorize
?client_id={app-id}
&redirect_uri={redirect-uri}
&scope=user_profile,user_media
&response_type=code
on the browser, which returned:
{"error_type": "OAuthException", "code": 400, "error_message": "Invalid platform app"}
I've also tried using Postman to perform a GET request as described by Facebook, and the response returns 404, shown below:
screenshot of postman GET request attempt
What am I doing wrong?

HTTP 400 for graph /sites endpoint - Error authenticating with resource

I'm getting an HTTP 400 on a request for https://graph.microsoft.com/v1.0/sites?search=* but expected response is an HTTP 200 w/ data.
It works successfully in multiple client environments (i.e. 100s of environments), but it doesn't work for one of our clients.
The application does successfully return calls for /groups, /domains, and other endpoints prior to hitting this HTTP 400.
The error is:
Error authenticating with resource
Response from remote side is:
{
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"request-id": "1d68c066-dba8-487e-b3a8-bd77f517d394",
"date": "2019-06-25T18:50:31"
}
}
I'm not sure the next steps from here. HTTP 400 suggests a malformed request, but I'm guessing this should actually be an HTTP 403 or 401 response instead of a 400?
Not sure how to resolve, please let me know, thanks!
edit: request-id added back in
If you're able to call other resources the same way (i.e. /groups), it would suggest a lack of permissions. Be sure the app or user authenticating has the required permissions:
Delegated (work or school account): Sites.Read.All, Sites.ReadWrite.All
Delegated (personal Microsoft account): Not supported.
Application: Sites.Read.All, Sites.ReadWrite.All
Documentation here

Unable to access Linkedin profile with valid oauth2 access token

I am having the same problem that is described in LinkedIn OAuth2: "Unable to verify access token"; however, the solution described there does not fix my problem.
I am able to successfully request an access token; however, when I make a request with it (using either the Authorization header or the oauth2_access_token query param), I get a 401 failure:
$ curl "https://api.linkedin.com/v1/people/~?format=json&oath2_access_token=############"
{
"errorCode": 0,
"message": "Unable to verify access token",
"requestId": "Z9ZJ1MOUM0",
"status": 401,
"timestamp": 1440096560396
}
$curl --header "Authorization: Bearer #############" 'https://api.linkedin.com/v1/people/~?format=json'
{
"errorCode": 0,
"message": "Unable to verify access token",
"requestId": "Y1P2PEBEC3",
"status": 401,
"timestamp": 1440096564518
The strange thing about this is:
This problem doesn't surface if the user is logged into Linkedin.
If you wait five minutes, the request will just start working.
My guess this is a bug in Linkedin about latency of authorizing access codes based the users' logged in state, but I don't know.
Also I find it strange that the Linkedin authorization form reads, "Sign in to LinkedIn and allow access:"; however, when you put in your credentials and click "Allow access", you are not actually logged into Linkedin.
My code was working fine on last week. Anyone else seeing this?
Looks like you have oath2_access_token there instead of oauth_access_token ? Not sure if this is a hand-paste failure or the actual issue.
curl "https://api.linkedin.com/v1/people/~?format=json&oath2_access_token=############"
Try this it work for me
get('https://api.linkedin.com/v1/people/~?oauth2_access_token=*******&format=json');
Hope that help some one
This seems to be caused by triggering a security watchdog, i.e. after an invalid request or after requesting several access tokens without using them linkedin seems to stop validating tokens and responds 401 instead.
in fact you need to add the two following header :
Authorization : Bearear #ACCESS TOKEN#
x-li-src : msdk
regards

Resources