How to use API Key in Google Speech grpc Java library - java

How do I use an API Key in Google Speech grpc Java or any other library. For HTTP request I am able to see that we can append key=API_KEY as mentioned in
https://cloud.google.com/docs/authentication/api-keys.
But for the given libraries (https://cloud.google.com/speech/docs/reference/libraries#client-libraries-install-java) all examples show how to use the Credential file.
Please help.

Use metadata with a key of X-Goog-Api-Key. See this other answer. If you have API restrictions, you may need additional headers. For example, an iOS example mentioned a bundle id restriction.

Related

Implementing partial response in cloud endpoints v2 - Java

I created a simple API in cloud endpoints v2 using Java. I see there is one parameter with the name of fields in the API Explorer for partial response. But
this is not working for me.
I saw YouTube API which is using this. How can I implement it in my own API?
I'm not able to find any documentation.
Unfortunately, this is explicitly called out as an excluded feature of Endpoints 2.0 Java right now.
Here's an excerpt from that page for posterity:
Currently excluded features and tools
...
fields partial responses
However, the page does suggest submitting a feature request using the GitHub issue tracker if it is something that you would like to see in Endpoints.

How to setup Blogger API on Android

I want to make an app which will use Google's Blogger API V3. But I've got stuck at the setup part. I've made an API key on developer console. I've read trough several tutorials and samples and everywhere they use this object
Blogger
For example here:
Blogger example
I downloaded the Java client library, copied to my application's libs folder, added to the build path, but still can't use this Blogger object.
Java client library
Where can I get the library that contains the Blogger object?
It depends what do you want to do with the Blogger API. If you want to access non-public data you should use Oauth2.0 to authenticate so for that I suggest reading this
https://developers.google.com/android/guides/http-auth#retrieve_the_account_name
Then you will probably want to send request to your API (POST,GET, DELETE or others) in order to perform actions such as post on your blog, retrieve comments or posts from your blog.
I have found this link very usefull
http://arnab.ch/blog/2013/08/asynchronous-http-requests-in-android-using-volley/

Custom file properties in Dropbox Core API?

In the Google Drive API there is something called custom file properties - https://developers.google.com/drive/web/properties - and they can be used to add your own as key/value pairs:
{
'key': 'additionalID',
'value': '8e8aceg2af2ge72e78',
'visibility': 'PRIVATE'
}
I would like to do the same in a desktop Java application with the Dropbox Core API, but I cannot find anything. Am I missing something or is this simply not available in Dropbox Core API?
If there is something, please provide an example of how it would be used in Java. Thanks!
Looks like Dropbox has begun to implement this feature.
In API v2 there are such endpoints:
properties/template/add
properties/template/get
properties/add
properties/remove
properties/update
and so on.
Details looks at API Documentation.
But all of them are marked as:
PREVIEW - may change or disappear without notice
Good luck with it.
The Dropbox API now offers the (now non-preview) ability to add arbitrary key/value data to Dropbox files via "file properties":
https://www.dropbox.com/developers/documentation/http/documentation#file_properties
If you're using an official Dropbox SDK, there will also be corresponding methods for these endpoints.

Cloudfront limited time (signed) URL using Java AWS SDK

How do I create cloudfront signed URL using AWS SDK?
This really seems like it should be easy to do, but I just fail to see it. I generally understand how it works and could probably throw together plain Java code to do it myself. It seems weird that AWS SDK does not provide a method for this.
Earlier question but with C#: cloudfront private time limited url.
This link explains in theory how such cloudfront urls are generated, but without code examples
This link explains how it is done with Java, but it apparently uses JetS3t library instead of AWS SDK. at least I have been unable to locate the used CloudFrontService class in AWS SDK Javadoc
This link demonstrates how it is done for S3 using AWS SDK
This blog post I found referenced in another related question contains source code for a java class CloudFrontSecurityProvider to do the signing and it is not very complicated.
FYI - This blog explains how it is done in Java... very simple.
java.awsblog.com/post/Tx1VE22EWFR4H86/Accessing-Private-Content-in-Amazon-CloudFront

google java api for google search

Does google provide a Java server side api **(NOT java script).**I dont want the ajax api which works at clint side.
What i want is that the result returned for a keyword should return me search result in some specific data structure.Like List or set data structure.Then i want to manipulate the result according to my need in java code.
I had used such a java server site api for youtube.
They used to but is discontinued. Most likely because you can remove their ads ;-)
From Google's terms of service
You may not send automated queries of any sort to Google's system
without express permission in advance from Google.
So, no - use their AJAX API. The SAOP API is discoutinued, but I think you should be able to use it, unless it requires a key, in which case you are tied to the AJAX API
Technically, the statement quoted above doesn't mean you can't use some sort of server-side API - there are examples of that if you google around. It means you shouldn't do it, because sooner or later you will be blacklisted (banned), as violating the terms.
What you would be looking for now is the CustomSearch API:
They used to have a different API developers could use but it has been depreciated (Nov. 2009 I think) so this is a for cost service now. I am not aware how long it might have been a free service. The new API allows 100 free searches a day, but you have to be signed up for billing else anything above 100 searches will fail, here are the details:
http://code.google.com/apis/customsearch/v1/overview.html
And sorry yes, this would still be using Java Script but you could use this:
http://www.json.org/java/
There is at least a SOAP API that I'm aware of: Google SOAP Search API
I don't think Google wants 3rd parties to use their search engine for their own services/applications. You would get "we think you are a robot" error page as a result if Google thinks you are not a real person.
You can however try Google Custom Search

Categories

Resources