๐Ÿ”‘ Methods

Most of the methods below are also available on the ComexposiumConnect API. You'll also find API routes for the authentication, the user management, the third-party application management, and the selections management.

Open the login interface

Here is an example below that opens the SSO login interface:

comexposiumCap.openCap('login');

Open the account creation interface

Here is an example below that calls the SSO account creation interface:

comexposiumCap.openCap('register');

It is also possible to switch from the login interface to the account creation interface directly from the button "Create an account" in the footer of the widget:

Connexion!

On the pre-production environment, all the emails sent (account creation, password forgotten, newsletters... ) are redirected to our internal mailbox [email protected] You can request access to your contact at Comexposium.

Open the forgotten password interface

Here is an example below that calls the password reset interface:

comexposiumCap.openCap('request-password');

Resetting the password fires an email containing the password reset link like this:

https://myurl.com/#reset-password?token=XXXXXX

You will need to make sure that the main URL that you declare to Comexposium will not contain any redirection and make sure that the ComexposiumConnect SSO widget is installed too.

Remember that emails sent in the pre-production environment are intercepted and automatically landed into this email address: [email protected].

Open the generic messages interface

Here is an example below that calls the generic interface you can use to display messages:

comexposiumCap.openGenericCap('Title', 'Description');

The parameters (title and description) can take HTML tags like buttons, divs etc...

Authenticate a user

To authenticate a user, you can use the following method:

comexposiumConnect.loginUser("email", "password", false, function(result){
    // Here I can check my statusCode and do whatever I want
    if (result.statusCode === 0){
      // login successful
    } else {
      // login failed
      console.log(result.statusCode, result.message);
    }
  });

The third parameter is a boolean which corresponds to the stayConnected variable. The last parameter is a callback and is not mandatory.

Create a new user

To create a new user, you can use the following method:

comexposiumConnect.createUser("email", function(result){
    // Here I can check my statusCode and do whatever I want
    if (result.statusCode === 0){
      // create successful
    } else {
      // create failed
      console.log(result.statusCode, result.message);
    }
  });

Using this method is equivalent to using this endpoint of our API: /_plugin/Comexposium/user/create.

An activation account email will be automatically sent to the email address added as a first parameter. This email contains a link that will allow this user to create his password.

On the pre-production environment, remember that all the emails sent (account creation, password forgotten, newsletters... ) are redirected to our internal mailbox [email protected] You can request access to your contact at Comexposium.

Check if the user is logged in

You can check if a user is logged in. This method returns a boolean.

true: the user is logged in

false: the user is not logged in

comexposiumCap.isUserLogged();

Check the user status

You can get the user status. This method returns an array with all user status. If the user have no status, or if he isn't connected, the result will be an empty array.

You can add or remove any status by using our API

comexposiumConnect.getUserTypes(function(listOfUserType){
      console.log(listOfUserType)
    });

Disconnect a user

You can disconnect the user by doing:

 comexposiumCap.disconnectUser(list);

The user will be disconnected from all environments using the comexposiumConnect