Google API requested! - Displayed in firebase serve - firebase

I have trouble authenticating my Google API and have no clue how to solve it. I want to get my Firestore document by using the REST api but it gives me no data at all in postman.
http://localhost:5000/<project-id>/us-central1/api/todos
I have tried this in my project dir and using cmd.
set GOOGLE_APPLICATION_CREDENTIALS="/functions/util/apikey.json"
But still no changes.
Below is my terminal that shows the warning.

Related

Can't create Firebase Cloud Messages From Console

For some reason, I don't see the ability for me to create FCMs from the Firebase console. It's not a browser issue as I tried on multiple browsers. It's not a permissions issue either since I am the owner of the project.
I tried implementing cloud functions to send FCMs and ever since when I go into the Cloud Messaging panel of the Firebase console I can no longer see the option to create messages.
Any insight would help!
Update--This is the error I'm getting from the JavaScript console:

MediaLink issue when creating a file to Bucket

I am using GoLang along as Google App Engine for hosting my web services.
I have been succesful in creating a file to my Firebase storage bucket, but then I would like to get a clean url for it that can be retrieved by clients (iOS / Android) that are authentified with firebase Auth.
What would be the easiest way to get such a link ?
What I have tried :
Getting ObjAttrs object, the bucket object attributes after the creation of the file :
This way in Go
attrs, err := obj.Attrs(ctx)
and I do get the attributes, among them a value called MediaLink
A sample of this link would be "https://www.googleapis.com/download/storage/v1/b/MY_BUCKET/o/MY_FOLDER%2FMY_FILE_NAME?generation=1539262480095558&alt=media"
Problems :
If I try to open this link into a browser, I get the following error : "Anonymous caller does not have storage.objects.get access to...."
Fair enough, since I'm not authentified with Firebase Auth at this point
But I also tried from a iOS client which is properly authentified with Firebase Auth, and still the retrieval of the link failed.
On the web console, attached to my file in my bucket, I see a link such as this "https://firebasestorage.googleapis.com/v0/b/MY_BUCKET/o/MY_FOLDER%2FMY_FILENAME?alt=media&token=47630584-f05c-43a2-a04d-8fc21d207181"
This works on both browser and iOS clients.
Now is how can I get by code, in GOLang such URL ?
I have seen no documentation about this.

Error 403 because Google Cloud Vision client points to wrong project

I'm trying to work through the Google Cloud Vision Pyhon example but I'm getting an authentication error.
This is not my only Google Cloud project, and my GOOGLE_APPLICATION_CREDENTIALS environment variable is set to the path to my bigquery project. I thought I could override this by using this statement:
client = vision.ImageAnnotatorClient.from_service_account_json(key_path)
where key_path is the path of the json key file associated with my (Cloud Vision API-enabled) vision project. However, I'm getting the 403 error from this
response = client.label_detection(image=image)
Apparently, even though I specified the key file path for the ImageAnnotatorClient, it still looks at my bigquery project's credentials and spits the dummy because there is no vision API enabled for it.
Do I really have to change the environment variable every time I change the project?
It seems that the Cloud Vision project ID does not propagate to the Python environment from either the Cloud Console or the credentials file. I fixed the reference using the Cloud Console:
gcloud config set project my_vision_project
The label_detection call works now.

Fulfillment URL is not valid in Dialogflow | Using Cloud Functions

I was using Dialogflow API V1 until now and everything was working fine. It seems like the Dialogflow API V2 is now the default. I am not sure if this is the reason but I am not able to deploy cloud functions anymore.
In the fulfillment tab, it is not letting me enabled the cloud function toggle. Every time I try to enable and click deploy it gives me the following error:
Fulfillment URL is not valid
It's weird because I am not using fulfillment URL and still I am getting this error.
One workaround that worked for me when. I wanted to create a back up bot for my existing LIVE bot to use it for testing. I was getting the same issue once I restored my zip and after that try to edit the stock fulfillment.
What worked for me was, I edited the fulfillment first .index.js and package.json both after which I restored the bot using zip folder that added intents and entities to the agent. after which I was able to deploy cloud functions without getting the error.

Google Translate API authentication error

I am trying to call the Google Translate API and using the following to authenticate from my local - gcloud auth application-default login.
The command works successfully and I am authenticated but when I try to call the API i get the following error message which indicates that it is being read as an anonymous API call
google.cloud.exceptions.Forbidden: 403 Daily Limit Exceeded
I ran into this issue too this week,
I thought i was well authenticated but when i was running my code which is C# using the google translate API v2 package, it gave me the same 403 code daily limit exceeded,
I fiddled around with the CLI, made several accounts, service accounts API keys and all and it never worked.
https://cloud.google.com/dotnet/docs/getting-started/hello-world
this page, (the .NET guide part) says you should be using the google cloud platform plugin they release for visual studio, and login via that, i used it and it worked.
If you look on the bottom left part there are guides for any other language that you might be using. (consider adding that as info it helps me help you).
I would love it if it only worked via CLI but as long as it works i guess it's fine...

Resources