MyApps Context APIs and Access Journey SDK provide you all the Context info that allows you to personalize and localize the content and the experience.
However, you might need additional flexibility of using all the endpoints of the Cloud4Wi REST APIs. Instead of hardcoding the API Key and Secret in your app, you can retrieve a new set of API credentials directly usign the sessionkey and the App Secret associated with your app.
The API endpoint is:
The SDK can be included with your application by including the following tag in your HTML document.
Including the script in your application gives access to the MYAPPS object. This object encapsulates a handful of functions that allow your application to integrate itself into the Access Journey provided by Cloud4Wi.
Moves the user away from the page to the next destination on the Access Journey. This method is not available when the application is opened from the App Bar as it is not a part of the Access Journey.
Returns the URL that points to the next destination on the Access Journey. It is the same URL that would be used by the goNext() function to continue the Journey.
This method is not available when the application is opened from the App Bar as it is not a part of the Access Journey.
Moves the user away from the page to the Welcome Portal. In many cases, has the effect of going Next, but can also have the effect of going back. Useful for App Bar applications that can use it as a "back" button in lieu of not having access to the goNext() function.
Combines goNext() and goHome(). If available, will behave as goNext(), but revert to goHome() otherwise.
Takes as an argument a JavaScript Object that contains options that are applied to the navigation bar. The options it supports are a delayed timer before the continue button is revealed, foreground and background color, and the text shown in the upper left corner.
The options object does not have to be filled, as there are default options that can be relied upon. One simply has to omit an entry in the object to revert to the default settings.
The styling is hardcoded into the nav tag that is produced, so apart from JavaScript manipulation, custom styling is fairly limited.
This function changes the style of the "next" button produced by the renderNavbar function from hidden to inline-block.
Returns the value of the given argument parameter by parsing the URL.
Available parameters:
tgr: step of the Access Journey that invoked the App. The possible values are: - trOpn: Connect - trRgt: Sign up - trPlgn: Log in Attempt - trLgn: Log in - trLgt: Disconnect - false: When not part of the Access Journey
Retrieve the session data and executes the callback function, function(SessionData). SessionData is false if there is any error, which is logged in the console.
Example:
Returns the session key necessary for the call.
sk: session key, used for the
Context data allows to gather precious context information aobut the user, the location and access points where he is connecting and about the Cloud4Wi Org the user belongs to.
There are two ways to retrive the Context data:
Context APIs
Javascript SDK
Making a GET request to the API url with the session key appended will return with a json object depending on the context with which the API was called. For example, calling the API from the Admin Panel will return different results than calling it from within the access journey.
The API endpoint is:
Response when used in the Cloud4Wi Dashboard From Organization level
Response when used in the Access Journey
User is Not logged in
User Authenticated and logged in
Below an example in PHP that uses the session key to retrieve the context attributes.