google-url-shortener

google URL shortener API error (403 forbidden) [update]

非 Y 不嫁゛ 提交于 2019-12-23 02:32:18
问题 So I'm trying to use Google URL Shortener API in my app. Here's the class I wrote to make the HTTP call and retrieve the shortened URL. public class GoogleUrlShortnerApi { //API Key from Google private const string key = "-----------MY_KEY-----------"; public static string Shorten(string url) { string post = "{\"longUrl\": \"" + url + "\"}"; string shortUrl = url; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.googleapis.com/urlshortener/v1/url?key=" + key); try {

Android sharing intent with google maps location and URL Shortener API

三世轮回 提交于 2019-12-08 05:01:12
问题 I am trying to share a location with latitude and longitude as; String uri = "http://maps.google.com/maps?daddr=" + latLngMaps.latitude + "," + latLngMaps.longitude; Using these lines of code: Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); String ShareSub = pharmacyName + "\n" + pharmacyAddress; sharingIntent.putExtra(Intent.EXTRA_TEXT, ShareSub + "\n" + shortURL); startActivity(Intent.createChooser(sharingIntent, "Share With?")); What I want to do

Android sharing intent with google maps location and URL Shortener API

我是研究僧i 提交于 2019-12-06 16:05:10
I am trying to share a location with latitude and longitude as; String uri = "http://maps.google.com/maps?daddr=" + latLngMaps.latitude + "," + latLngMaps.longitude; Using these lines of code: Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); String ShareSub = pharmacyName + "\n" + pharmacyAddress; sharingIntent.putExtra(Intent.EXTRA_TEXT, ShareSub + "\n" + shortURL); startActivity(Intent.createChooser(sharingIntent, "Share With?")); What I want to do is: I am using URL shortener api and converting the "http://maps.google.com/maps?daddr=" + latLngMaps

How to set the user for the Google URL Shortener API Quota?

£可爱£侵袭症+ 提交于 2019-12-05 22:28:24
问题 The Google API console shows a Quota of "1,000,000 queries per day" and "100 queries per 100 seconds per user". Both of these quotas are editable in the console, but the maximum enterable value is 1,000,000 and 100 respectively. I am bumping up against the 100 queries per 100 seconds per user and get a 403 User Rate Limit Exceeded. Other Google APIs have a parameter "quotaUser" which is an arbitrary string to identify a user which you can apply the above 100 queries per 100 seconds quota to.

How to POST request to Google Shortener API with Google API Java Client and parse a JSON response?

限于喜欢 提交于 2019-12-03 22:26:58
问题 I want to use the Google Shortener API. I want to use the google api java client library to post a request and parse the JSON response. Next, I post the code I have tried: import java.io.IOException; import net.sf.json.JSONObject; import com.google.api.client.googleapis.GoogleHeaders; import com.google.api.client.googleapis.GoogleTransport; import com.google.api.client.googleapis.json.JsonCParser; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse;

How to POST request to Google Shortener API with Google API Java Client and parse a JSON response?

北城余情 提交于 2019-12-01 00:31:47
I want to use the Google Shortener API . I want to use the google api java client library to post a request and parse the JSON response. Next, I post the code I have tried: import java.io.IOException; import net.sf.json.JSONObject; import com.google.api.client.googleapis.GoogleHeaders; import com.google.api.client.googleapis.GoogleTransport; import com.google.api.client.googleapis.json.JsonCParser; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.JsonHttpContent;

Cross Domain Issue with implementing Google URL shortener API

廉价感情. 提交于 2019-11-29 21:30:44
问题 I am trying to implement the Google URL shortener API with the help of jQuery by making an AJAX call. I have done something like this: $(function() { $('#btnshorten').click(function() { var longURL = $('#tboxLongURL').val(); $.ajax({ url: 'https://www.googleapis.com/urlshortener/v1/url?shortUrl=http://goo.gl/fbsS&key=AIzaSyANFw1rVq_vnIzT4vVOwIw3fF1qHXV7Mjw', type: 'POST', contentType: 'application/json; charset=utf-8', data: '{ longUrl: "' + longURL +'"}', dataType: 'json', success: function

Google URL Shortener 403 Rate Limit Exceeded

懵懂的女人 提交于 2019-11-29 11:12:06
问题 Using the google url shortener api, it was working fine till I started testing at load. Quickly started getting back 403 Rate Limit Exceeded errors from Google, even though I signed up to use the API and it comes with 1,000,000 hits a day. I can see the requests coming in on the google reporting tool, and they are just sending back 403's for everything. 403's started coming back at around 345/350 hits to the API, have been continuing for hours. Thoughts? 回答1: The API limits requests to 1