Mirror API Playground not posting to timeline - google-mirror-api

I believe I've gone through all the steps of creating a (web) client-id for authorizing requests from the Mirror API Playground, yet when I hit the Authorize button, and then Insert a card from a template, nothing is sent to glass.
I also note that the Timeline tab below is empty.
Web I bring up developer tools, I note that the POST to https://www.googleapis.com/rpc is returning results:
[
{
"error": {
"code": 403,
"message": "Access Not Configured",
"data": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
]
},
"id": "gapiRpc"
}
]
Am I missing something in how to authorize the Mirror Playground?

You need to enable the Google Mirror API.
Do this by toggling the switch on the Services panel for your project as pictured here:
. This toggle will only be visible if you have been whitelisted for the Google Mirror API as part of the developer preview.

Related

Error 403, Metadata scope doesn't allow format FULL . Web application Gmail API get message through postman

I'm getting forbidden 403 error when hitting Gmail API get message through postman please help me how to solve this. error
https://www.googleapis.com/gmail/v1/users/userId/messages
this url for getting message list
https://www.googleapis.com/gmail/v1/users/userId/messages/id
this is for getting message for particular id
I can able to hit the get message list API but get Message API not working for me
I'M doing all these stuff through postman
error message :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Metadata scope doesn't allow format FULL"
}
],
"code": 403,
"message": "Metadata scope doesn't allow format FULL"
}
}
This is another disappointing design in the Gmail API. I resolved this issue with the following steps:
Remove GmailScopes.GMAIL_METADATA from scopes setup.
Remove the credential file from your local FileSystem. This file is generated by Google's Authorization Flow which store your credential locally.
Re authorize your app by signing in again https://accounts.google.com/o/oauth2/auth?access_type=offline....
Hope this helps you guys out.

How to detect if Google account hasn't Gmail

How can I recognize Google accounts without Gmail?
I use OAuth2 for authorization and then download user messages.
But if Google account hasn't Gmail, then I receive the error while getting data from api:
{
"errors": [
{
"domain": "global",
"reason": "failedPrecondition",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
What is the best way to detect accounts without Gmail?
Now I just send test GET request to gmail-api and check that it returns OK.
But I'm looking for best solution.

User not authorized to perform this action when setting IAM policy

I am setting up a topic and trying to grant permission to gmail to send email notification to this topic, but the API call throws "User not authorized to perform this action". I get the same error when I tried from the https://cloud.google.com/pubsub/reference/rest/v1/projects.topics/setIamPolicy. BTW, I started seeing this issue recently. It was working fine before.
POST https://pubsub.googleapis.com/v1/projects/macro-xxxxx-xxx/topics/exxxxx-inxxx:setIamPolicy?key={YOUR_API_KEY}
{
"policy": {
"bindings": [
{
"role": "roles/pubsub.publisher",
"members": [
"serviceAccount:gmail-api-push#system.gserviceaccount.com"
]
}
]
}
}
{
"error": {
"code": 403,
"message": "User not authorized to perform this action.",
"status": "PERMISSION_DENIED"
}
}
Appreciate any help, Thanks.
You likely do not have permission to modify the topic in question. You need at least the Pub/Sub Editor or Pub/Sub Admin permission to modify the allowed publishers on a topic. These can be more easily changed in the IAM Console than by the REST API.

GAE Endpoint Security testing with local dev envrionment

I am trying to secure my GAE service endpoints. So I added the following annotations to my service class and deploy this service to GAE:
#Api(name="mytestapi",version="v2", description="An API for testing" ,
scopes = {Constants.EMAIL_SCOPE},
clientIds = {Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID, Constants.API_EXPLORER_CLIENT_ID},
audiences = {Constants.ANDROID_AUDIENCE})
When I try to access my service with the API explorer at the Google Development Server everything works fine. I receive the answer that the User is authorized but when I try to access this service from my local machine I just receive the message that the user is not authorized
GET http://localhost:8888/_ah/api/mytestapi/v2/ .....
Authorization: Bearer ya29.1.AADtN_X_Uku4qj0ehwOwRqLLmKvbIOOYOCC2KXOnVskUXT7Yy19bNsiIGepXTzI
X-JavaScript-User-Agent: Google APIs Explorer
401 Unauthorized
- Show headers -
{
"error": {
"message": "User is Not Valid",
"code": 401,
"errors": [
{
"domain": "global",
"reason": "required",
"message": "User is Not Valid"
}
]
}
}
Any Idea what I have missed to configure or what I am doing wrong?
Regards
Michael
In the credentials of your application, on the console Google, you have to add the localhost origin in the Javascript Origins, section Client ID for web application.

"Access not configured" when accessing google cloud endpoints from web app

I wrote a webapp with angularjs frontend, google app engine for storing data, and google cloud endpoints for api access from the frontend client. I tested everything fine locally, but after deploying, accessing the api from the frontend javascript client gives me the following error:
[
{
"error": {
"code": 403,
"message": "Access Not Configured",
"data": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
]
},
"id": "gapiRpc"
}
]
I've checked the production api explorer after deployment and it works fine. Also, I tried directly accessing the api by URL which also works fine. Just the frontend client does not work. Any ideas?
Turns out I set the API key in the client with gapi.client.setApiKey(API_KEY); where the API Key is the browser key from the cloud console. I removed this and it works fine. I have no idea what the API key is for.
I'm looking at the problem now on one of my projects. Might be that the ipv6 address must be registered for the project. Take a look at this post Google API returning Access Not Configured
The usual reason for this is that the API, which is being queried is not yet enabled in Google Console by the time of the request. Once it is turned on - error goes away.

Resources