The url.insert method creates a new short URL. Try it now.
Authentication is optional for the url.insert method. If an authentication token with access to
https://www.googleapis.com/auth/urlshortener is provided, the method creates a short URL for the authenticated user. The short URL created will appear in the authenticated user's list method results and on their dashboard at http://goo.gl/. If no authentication is provided, the short URL that the method creates is not associated with any particular account.
When creating a new short URL, you must supply a URL Resource as the message body. Note that for a new short URL, only the
longUrl property is required.
This method requires one query parameter:
- Your API key (using the
keyquery parameter). Note: You can omit the query parameter when making a limited number of calls, such as during the testing phase.
The returned resource contains the short URL and the long URL. Note that the returned long URL may be loosely canonicalized, e.g. to convert "google.com" into "http://google.com/".
In the request body, supply an Url resource.
If successful, this method returns a response body with the following structure:
||Long URL to be shortened, e.g. "http://www.google.com/".|
Use the explorer below to call this method on live data and see the response. Alternatively, try the standalone explorer.