How can enable Dialogflow API using google cloud API - google-api

How can I enable the dialogflow api automatically, I want to create a dialogflow agent using the api, but get an error:
google.api_core.exceptions.PermissionDenied: 403 Dialogflow API has not been used in project 79080971371 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dialogflow.googleapis.com/overview?project=79080971371 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry

There is no way to automatically enable APIs in projects on Google developer console. There are some things in your project that need to be configured by you the developer.
You need to manually go to your project and then go to library and enable the API you are trying to access. In this case enable dialogflow api

Related

Best way to access Google APIs without user authorization from desktop application

I am trying to make a desktop application with Twitch API and Google API.
Since this application requires Twitch user permission, a user needs to authorize my application through twitch's OAuth and I think there's no way to omit this process.
Now, I want to add some functionalities from Goole APIs, for instance TTS.
My application will be installed and run on user's local machine,
it cannot store API key or credential information safely.
I think I have three options:
Add Google OAuth: This is most safe way, I think, but I don't think I can convince users to authorize another Google account even though they already authorized their Twitch account.
Make a kind of proxy server which verifies request for Google API using twitch authentication information and relays request to/response from Google API. This seems feasible but it requires additional payment to running server for sending data from Google API. I already have to pay for TTS service, another payment for proxy server which sends binary data frequently would be a financial burden for me.
Make a server to acquire API key for Google API. This also requires additional server, but it does not involve lots of traffic because application will access Google API directly once API key acquired. However, I concern that the API key may be easily stolen using monitoring tool such as wireshark.
Which method should I use here, and how can I improve it?
Or, is there better way for this case?

The application utilizing the gmail-api must run in Goolge Cloud Platform?

When I want to use Google's Gmail API within my web application in order to receive and send emails, then must this web application be deployed in the Google Cloud as a precondition and any on-premise hosting will fail? Is this the price one must pay to use it?
Your application's code can be hosted anywhere you want. However, you do need to create a Google Cloud account to create a project, enable the APIs and get the application credentials:
Cloud APIs use application credentials for identifying the calling applications. Credential types include API keys, OAuth 2.0 clients, and service accounts. You can use Google Cloud console to create, retrieve, and manage your application credentials. For more information about application credentials, see Authentication Overview.
Once you have your project's credentials you can just create the code within your current app and use the credentials wherever they are needed. You can refer to one of Google's quickstarts for that.
Sources:
Getting started with Google Cloud APIs
Developing on Google Workspace
Gmail API Overview

Setting up Dialogflow CX to save audio recordings in Google Cloud Storage

I have setup a Google Cloud Storage bucket in the same project as my Dialogflow CX Agent, and in the settings for the agent, under the Speech & IVR tab, set the Google Cloud Storage URI to match that bucket:
gs://my-bucket/calls
I can see that the Dialogflow Agent has access to the bucket as it has a Service Agent listed in the Permissions tab of the bucket.
Furthermore, since I successfully enabled logging, I can see that the bucket is correctly configured, as in the log payload I can see the following property:
interactiveVoiceResponseSettings: {
audioExportGcsDestination: {
uri: "gs://my-bucket/calls"
}
}
However, when making calls, nothing appears on that bucket's folder.
Is there another configuration option I'm missing to enable this feature?
Or perhaps it is not yet functional?
Thank you.
The 'Google Cloud Storage URI' option in the Dialogflow CX Speech and IVR agent settings is currently supported for the following use cases:
If you use 1-click telephony partner integrations (for example,
AudioCodes or Avaya)
If you use the Contact Center AI solution
provided by Google partners.
If you use 1-click telephony partner integrations, and the 'Google Cloud Storage URI' option is not working for you, please check the following:
Go to the GCP project IAM and find the automatically created service account of the format one-click#df-cx-<ALPHANUMERIC_VALUE>-<ALPHANUMERIC_VALUE>.iam.gserviceaccount.com
Make sure that this service account has the 'GCS Storage Bucket Owner' role assigned to it.
Note that the 'Google Cloud Storage URI' option doesn't support the detect Intent API requests.

Confusion regarding the enable option in Google API

in my account the google drive api is disabled but still when I authenticate a thirdparty app using oauth2.0 it can access my drive files. Then what is the use of this enable api.
Cloud developer console is a place for developers to create applications. when you create a new application you must decide which APIs will be used by that application.
I authenticate a third party app using oauth2.0 it can access my drive files
Unless you are the developer of the third party application setting this will not have any effect on what applications created by other developers can do with your account. If you dont want them accessing your drive account then dont install any third party applications that request permission to access your drive account.

AzureRM Application Gateway Rest API

I am trying to create Azure Application Gateway with SSL certification. I have successfully created it using Azure Power-Shell.
Now I want to create it using Rest APIs so that I can use/call them in my code (ruby). My question is: Is there any Rest API exist to create AzureRM Application Gateway? Because I am not able to find any. I've gone through the following link
https://msdn.microsoft.com/en-us/library/azure/mt420159.aspx
It has the APIs present for Application Gateway but for classic mode not for RM mode.
Now I want to create it using Rest APIs so that I can use/call them in
my code (ruby). My question is: Is there any Rest API exist to create
AzureRM Application Gateway? Because I am not able to find any
There's a REST API but at this moment it is not documented and hence you are not able to find it. As a workaround, what you could do is run PowerShell Cmdlets with -Debug switch. Then you will see the request URL as well as request body sent to create an Application Gateway. You can use that in your ruby code.

Resources