Version 1.6 - Updated on 03/23/2017
Authorize API call, used to start the OAuth 2.0 process. Can only be called after the API has been initialized with a client key, client secret, and callback URL. This API redirects the current page to the sign-in screen.
Returns an authorization URL that a user can redirect to in order to start the Oauth 2.0 process.
Initialization method used to setup the SDK. Must be the first API called.
initObject— Lifecycle callbacks and parameters
initObject.clientKey— Key for your application
initObject.clientSecret— Secret for your application
initObject.callbackUrl— Callback URL for your application
initObject.htmlEscape— HTML escapes all responses when set. Defaults to true.
InitObject.authToken— Access token that may optionally be passed to bypass authentication. The SDK will run the
postAuthenticatedcallback and be in a logged in state if this parameter is set.
initObject.refreshToken— Refresh token that may optionally be passed with an access token. The SDK will automatically try to refresh if a token expires and a refresh token is present.
postInitializeis called when the api is initialized and ready to be used. The callback contains a boolean value to let a client know if the API has been initialized successfully.
postAuthenticatedis called after the SDK has attempted to authenticate a user, either by exchanging an access token or receiving it in the
initmethod. The callback has two arguments, a boolean flag which is set when authentication was successful, and an error code which is set only when the SDK could not authenticate.
initObject.onAuthInvalidated— Method called after the SDK has received a 401.
Helper method that a client can use to check if the SDK has authenticated a user by completing the OAuth 2.0 process
booleanvalue that is set if the SDK has successfully completed the OAuth 2.0 process.
Helper method that you can use to check if the SDK has been successfully initialized.
booleanvalue that is set if the SDK has been successfully initialized.
JQuery-like ready handler that can be used to execute code after
callback— Function that you can run when the SDK is ready for use. This function does not take any argument.
Final part of the oauth 2.0 process. Exchanges an authorization code for access tokens. This API can only be called after
thingspace.cloud.init() has been called. This function is called automatically by the SDK when an authorization code is present in the URL. After success or failure,
postAuthenticated lifecycle method is called.
requestObject— Callbacks and parameters
requestObject.success— Success callback function. Returns the response in the first argument.
requestObject.failure— Failure callback function. Returns the response in the first argument.
Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.