Class: UROAuth

UROAuth(options)

The Urban Rivals API

Constructor

new UROAuth(options)

Parameters:
Name Type Description
options Object API options
Properties
Name Type Attributes Default Description
key String Application key
secret String Application secret
algorithm String <optional>
'HMAC-SHA1' Signing method
authorizeCallback function <optional>
null Callback called when authorized
Source:

Extends

  • OAuth

Members

accessToken :Token

Access token
Type:
Source:

(readonly) API_URL :String

query URL
Type:
  • String
Source:

(readonly) AUTHORIZE_URL :String

Authorization URL
Type:
  • String
Source:

proxyClient

Creates a proxy client to call API with syntaxic sugar
Source:

requestToken :Token

Request token
Type:
Source:

Methods

getAccessToken(requestTokenopt) → {Promise.<Token>}

Get access token from request token
Parameters:
Name Type Attributes Description
requestToken Token <optional>
Request token
Source:
Returns:
Type
Promise.<Token>

getAuthorizeUrl(callbackUrlopt) → {string}

Get the authorization URL for the player
Parameters:
Name Type Attributes Description
callbackUrl <optional>
The callback url for the query
Source:
Returns:
The authorize URL
Type
string

getRequestToken() → {Promise.<Token>}

Get request token
Source:
Returns:
Type
Promise.<Token>

multipleQueries(…queries) → {Promise.<Object.<String, QueryResult>>}

Do one or more queries on the UR API
Parameters:
Name Type Attributes Description
queries Object <repeatable>
All queries to do
Properties
Name Type Attributes Default Description
call String Call name
params Object <optional>
{} params of the query
contextFilter Array <optional>
[] filter on the received context attributes
itemsFilter Array <optional>
[] filter on the received items attributes
Source:
Returns:
The queries results, indexed by the call name
Type
Promise.<Object.<String, QueryResult>>

(async) query(call, paramsopt, filtersopt) → {Promise.<QueryResult>}

Do one query
Parameters:
Name Type Attributes Default Description
call String Call name
params Object.<String, *> <optional>
{} Call params
filters APIFilter <optional>
{} All filters you want on your query result
Properties
Name Type Attributes Default Description
itemsFilter Array.<String> <optional>
[] Filter on items sent by the server
contextFilter Array.<String> <optional>
[] Filter on context sent by the server
Source:
Returns:
The query result
Type
Promise.<QueryResult>