Google Cloud Text-to-Speech API Authentication from the frontend via API key possible? - api

The use case is a frontend application that does not have any backend so normally I would expect to use an api key ( https://cloud.google.com/docs/authentication/api-keys ) but in the complete text to speech documentation ( https://cloud.google.com/text-to-speech/docs/ ) I can't find any information about if (and how) its possible to use api keys for the Cloud Text-to-Speech API.
I don't think its such an uncommon use case to use the text to speech functionality in a standalone frontend (especially with the new WaveNet voices), so I thought I would ask the question here if anyone has some tips where to look for this information or if it's currently really only ment as an API usable in the backend.

If you have the same problem that I am facing right now then I can help you. I have the same issue asked in this question.
If you are using webpage to translate then you have to send your API key in URL of the request. The one way I tried is,
https://texttospeech.googleapis.com/v1beta1/text:synthesize?fields=audioContent&key={Your key goes here}.
I hope this will solve your problem.

Related

How to create my own API and connect it to Power apps?

I really hope you can help me. I have a project to create an app. I will use Power apps, Python and JavaScript. I need to be in it, because I am not. So my first step is create an API, I have decided to use Azure Function I can explain why. It helps connect my Power Apps(frontend, where i am going to use JavaScript) to backend(Python).
So I have absolutely nothing and I have decided to create an API with Azure Functions, the truth is i dont really know how it works. I can connect it with VScode, but the main question how to create own API? I dont need to pay for servis because I have an Azure Functions which is paid. But I dont really understand how API has too look. I have find a lot information but i cant connect it with what I need.
I need to write my own code for API? Like from empty file? Can do it in VS code and connect it with Azure Functions? What has to be in API I mean my own piece of code or something another? Have anyone created his own API in Azure Functions?
thank you for answering my stupid questions
You can create the Http Trigger in Azure Function if your own API works on HTTP protocol and modify the default Http Trigger API Code according to your requirement.
If your API contains 3rd party APIs, you can create the Http client inside the function code for sending HTTP requests on to the available 3rd party APIs in your function code.
There are plenty of articles on connecting the Azure Functions to Power BI Apps where you can write your own AP code using REST API signature following swagger and add that custom API in Power Apps.
Refer to this article that provides the use case of connect the Azure Function with custom API Code to Power App, given by Carlos Aguilar.

How to call Google NLP Api from a Google Chrome extension

My aim is to select some text from a web page, start a google chrome extension and give the text to a google cloud api (Natural Language API) in my case.
I want to do some sentimental analysis and then get back the result to mark/ highlight positive sentences in green and negative ones in red.
I am new to this and do not know how to start.
The extension consists of manifest, popup etc. How should I call an API from there that does Natural Language Processing?
Should I create a Google Cloud Application with an API_KEY to call? In that case I would have to upload my credentials right?
Sorry sounds a bit confusing I know but I just don't know how I can bring this 2 things together an would be more than happy about any help
The best way to authenticate your app will depend on the specific needs and use cases of your application. You can see an overview of all the different methods here.
If you are not planning on identifying users nor on using a back end server that handles authenticating (as I assume to be your case), the best option would indeed be to use API keys. They do not identify the user, but are enough for the Natural Language APIs.
To do this you will need to create an API key for the services you want and add the necessary restrictions to make the key as secure as possible. Detailed instructions on how to do this and how to use the key in a url can be found here.
The API call could be made from within the Chrome extension with any JavaScript method capable of performing POST requests. For example using XMLHttpRequest or the Fetch API. You can find an example of the parameters that need to be included in the request here.
You may run into CORS issues when making the request directly from the extension. I recommend reading this answer, where a couple of workarounds for these issues are suggested.

How to get Google Cloud Translation used Chars via API?G

how do i get information from this page 'https://console.cloud.google.com/iam-admin/quotas' programmatically, i couldn't find any API service to do this, is there a way to do it?
Currently, this is not possible to achieve, however, there's a feature request to consider having this functionality.

How to get API key for getting the email previews using Litmus?

How to get the API key for the authentication purposes for posting the request to get the email previews using Litmus?
There are actually a few different Litmus Preview APIs to cater to different use cases. We're in the process of simplifying this, partly in the hope of making the experience for a new API user a little more obvious.
If you reach out to hello#litmus.com we'll direct you to the appropriate API version and how to obtain your key.

Connecting to CJ API

Im trying to make a REST api work with VB.NET (http://help.cj.com/en/web_services/web_services.htm#Commission_Detail_Service.htm)
This is CJ commission's API.
The problem I have is that Im trying to add the service reference https://commission-detail.api.cj.com/v3/commissions but its not working, and when I go straight to that address on the web browser, its asking me for the developer key, which I have, but I dont know how to enter it.
Does anyone have a sample code on how to connect to that API?
Thanks!
I guess you don't need it by this time, but still, for those who'll have the similar question and get to this page: you should pass your developer key as the authorization header of your request. Depending on how you make requests, it could look something like this in VB.NET:
HttpWebRequest.Headers.Add("authorization", "your_dev_key")