How to create a guest demo account

Created: 1/21/2022 | Updated: 5/30/2024 | Status: Published

Step 1.    API call to create guest demo account:

    http://admin-api.ap-b.tradesmarter.com/crm/rest/create-demo-account?siteID=XXX


API response - userID. ***This is a "ghost user" in our system, there will be no records in the CRM.


Step 2. When you receive clientID from response to the previous call, you need to set the following cookie on the client's browser:\

    name: 'demoAccountID'\

    value: clientID (the ID you got from the API call)\

    expiry: set to expire after the demo account expires\

    path: '/'\

    domain: '.' + your domain (without the subdomain: not 'www.xyz.com', just '.xyz.com')\


    Javascript code example:\

        document.cookie = "demoAccountID=abc12345; expires=Thu, 17 Dec 2020 12:00:00 UTC; path=/; domain=.xyz.com/";\


    or use Cookies library https://github.com/js-cookie/js-cookie\

    Cookies.set('demoAccountID', 'abc12345', \{ expires: 7 \})\


Step 3. Redirect the client's browser to widgets or trading platform after setting the cookie (to the page you usually redirect clients after login). Loading of the platform with the demo account will be performed automatically.