src/server-methods.js
function(code, callback) {
    return AuthenticationRequest.builder()
      .withPath('/api/token')
      .withBodyParameters({
        grant_type: 'authorization_code',
        redirect_uri: this.getRedirectURI(),
        code: code,
        client_id: this.getClientId(),
        client_secret: this.getClientSecret()
      })
      .build()
      .execute(HttpManager.post, callback);
  }
function(code, callback) {
    return AuthenticationRequest.builder()
      .withPath('/api/token')
      .withBodyParameters({
        grant_type: 'authorization_code',
        redirect_uri: this.getRedirectURI(),
        code: code,
        client_id: this.getClientId(),
        client_secret: this.getClientSecret()
      })
      .build()
      .execute(HttpManager.post, callback);
  }
function ( code , callback ) { return AuthenticationRequest . builder ( ) . withPath ( '/api/token' ) . withBodyParameters ( { grant_type : 'authorization_code' , redirect_uri : this . getRedirectURI ( ) , code : code , client_id : this . getClientId ( ) , client_secret : this . getClientSecret ( ) } ) . build ( ) . execute ( HttpManager . post , callback ) ; }
Request an access token using the Authorization Code flow.
Requires that client ID, client secret, and redirect URI has been set previous to the call.
@param {string} code The authorization code returned in the callback in the Authorization Code flow.
@param {requestCallback} [callback] Optional callback method to be called instead of the promise.
@returns {Promise|undefined} A promise that if successful, resolves into an object containing the access token,
refresh token, token type and time to expiration. If rejected, it contains an error object.
Not returned if a callback is given.
Request an access token using the Authorization Code flow . Requires that client ID client secret and redirect URI has been set previous to the call .