oAuth
vendor/Oauth.js
new Oauth(grantType, tokenKey)
Class containing methods to authenticate and make authenticated requests with a third party API
Parameters
grantType
string
Oauth grant type. One of: refresh_token
, password
, or custom
.
tokenKey
string
The key of the secret containing the oAuth token information.
Examples
Returns
Void
constructor(grantType, tokenKey, hasHeaders)
Parameters
grantType
string
tokenKey
string
hasHeaders
boolean
Returns
Void
init()
Init the access token
Returns
Void
request(method, path, data, options)
Request method with the refresh token retry if fails.
Parameters
method
string
Request method.
path
string
Request path.
data
object
options
Types.RequestOptions
Additional configuration for Oauth calls
Returns
object
get(path[, options])
Make a GET request to an external Rest API
Parameters
path
string
Request path
options
Types.RequestOptions
Additional configuration for Oauth calls
Optional
Returns
object
post(path, data[, options])
Make a POST request to an external Rest API.
Parameters
path
string
Request path
data
object
Request payload
options
Types.RequestOptions
Additional configuration for Oauth calls
Optional
Returns
object
put(path, data[, options])
Make a PUT request to an external Rest API.
Parameters
path
string
Request path
data
object
Request payload
options
Types.RequestOptions
Additional configuration for Oauth calls
Optional
Returns
object
patch(path, data[, options])
Make a PATCH request to an external Rest API.
Parameters
path
string
Request path
data
object
Request payload
options
Types.RequestOptions
Additional configuration for Oauth calls
Optional
Returns
object
delete(path[, options])
Make a DELETE request to an external Rest API.
Parameters
path
string
Request path
options
Types.RequestOptions
Additional configuration for Oauth calls
Optional
Returns
object
Last updated