SoundCloud.getAccessToken()

Generate a new access token for acting on behalf of a particular SoundCloud user account.

Note that you must first have a valid `code` from the user proving that they're OK with this. You can get a code by redirecting the user to the url generated by calling the `getLoginUrl(...)` machine.

Usage

Hover over inputs/exits for more info.

var SoundCloud = require('machinepack-soundcloud');


// Generate a new access token for acting on behalf of a particular SoundCloud user account.

SoundCloud.getAccessToken({

clientId: 'cb4917402e7e92b3908cfaf84f52fe45',

clientSecret: 'd0db89af37eef3185a29f0acfed46a9f',

code: '51edf90c46322a805ada32a33f1cc30f',

callbackUrl: 'http://localhost:1337/auth/soundcloud/callback',

grantType: [ 'authorization_code' ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

clientId required

The unique identifier for your Soundcloud app (i.e. this is the "Client ID" listed on your app's dashboard page in the SoundCloud developer portal, e.g. http://soundcloud.com/you/apps)

'cb4917402e7e92b3908cfaf84f52fe45'
clientSecret required

The developer "secret" for your SoundCloud app (i.e. this is the "Client Secret" listed on your app's dashboard page in the SoundCloud developer portal)

'd0db89af37eef3185a29f0acfed46a9f'
code required

The OAuth `code` generated by SoundCloud and sent to the `callbackUrl` if the user chooses to grant your app the requested permissions

'51edf90c46322a805ada32a33f1cc30f'
callbackUrl required

The redirect URL that was used when generating the provided `code`

'http://localhost:1337/auth/soundcloud/callback'
grantType

The OAuth `code` generated by SoundCloud and sent to the `callbackUrl` if the user chooses to grant your app the requested permissions

[ 'authorization_code' ]

Exits

error

An unexpected error occurred.

success

OK.

{ token: '04u7h-4cc355-70k3n', scope: 'non-expiring' }