GoogleAPIsURLShortener.urlGet()

Expand a short URL

You can call this method to expand any goo.gl short URL. For example, to expand http://goo.gl/fbsS to narmal URL

Usage

Hover over inputs/exits for more info.

var GoogleAPIsURLShortener = require('machinepack-googleapisurlshortener');


// Expand a short URL

GoogleAPIsURLShortener.urlGet({

shortUrl: 'http://goo.gl/xKbRu3',

projection: 'ANALYTICS_TOP_STRINGS',

fields: 'analytics,created,id,kind,longUrl,status',

key: 'AIzaSyAYVDlaoVs_GZw9JNvSclRWH_PEMKII6tc',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Invalid field parameter passed

invalidParameter: function () {

 

},

// Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.

dailyLimitExceededUnreg: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

shortUrl required

Short URL

'http://goo.gl/xKbRu3'
projection

Additional information to return.

'ANALYTICS_TOP_STRINGS'
fields

Selector specifying which fields to include in a partial response

'analytics,created,id,kind,longUrl,status'
key

Your api key

'AIzaSyAYVDlaoVs_GZw9JNvSclRWH_PEMKII6tc'

Exits

error

An unexpected error occurred.

invalidParameter

Invalid field parameter passed

dailyLimitExceededUnreg

Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.

success

OK.