Applications

To integrate SideDrawer into your app or environment, you'll need:

  1. An <iframe> with the desired source or app route
  2. To call postMessage to the iFrame after it has fully loaded

Creating the <iframe>

First, get a developer management token using the following endpoint:

POST /api/v1/developers/tenant/tenant-id/{tenantId}/applications/client-id/{clientId}/developer-login

This will return a developer token ("access token").


With this token, you can now "assume" a user's role:

POST /api/v1/developers/tenant/tenant-id/{tenantId}/applications/client-id/{clientId}/user-login

This returns a different token -- a token for a regular user, not a developer. Also returns the OpenID of the user whose role we're "assuming".


Calling postMessage

JavaScript example:

<iframe id="sd-iframe" style="width: 800px; height: 600px;"></iframe>
<script>
  const $iframe = document.getElementById("sd-iframe");

	// For My App routes:
	const BASE_URL = 'https://my-dev.sidedrawersbx.com'; 
	
	// For Console routes:
	const BASE_URL = 'https://console-dev.sidedrawersbx.com';

	const endpoint = '/dashboard';
	const accessToken = 'YOUR_ACCESS_TOKEN';
	const locale = 'en-CA';
	const brandCode = 'yourBrandCode';

	const src = ${BASE_URL}${endpoint};

  $iframe.addEventListener("load", () => {
    $iframe.contentWindow.postMessage(
      {
        token: accessToken,
        locale: locale,
        brandCode: brandCode,
        src
      },
      BASE_URL
  );
  });

	$iframe.src = src;
</script>

Modify the following parameters as needed:

postMessage parameters:

ParameterDescription
tokenJWT access token
localeIdUser locale (for example, en-CA, es-US, etc.)
brandCodeAffiliate code, branding configuration
srcFull iFrame URL (BASE_URL + endpoint)

Endpoint options

My App Route options:

DescriptionPath
New Folder (record)/core/home/{sideDrawerId}/my-sd/records/form/new/files
New Folder (record) with recordType/core/home/{sideDrawerId}/my-sd/records/{recordType}/form/new/files
Copy/Move Folder (record)/core/home{sideDrawerId}/my-sd/records/{recordType}/form/{recordId}/move
Existing Folder (record) with Tile/core/home/{sideDrawerId}/my-sd/records/{recordType}/form/{recordId}/files
Existing Folder (record) without Tile/core/home/{sideDrawerId}/my-sd/records/form/{recordId}/files
Info Request Details/core/home/{sidedrawerId}/plans/details/{infoRequestId}
Single File Request/core/home/{sideDrawerId}/workflows/simple-file-request-form
Create Reminder for Folder (record)/core/home/{sideDrawerId}/workflows/record/{recordId}/reminder
Update Reminder for Folder (record)/core/home/{sideDrawerId}/workflows/record/{recordId}/reminder/{reminderId}
Update Reminder/core/home/{sideDrawerId}/workflows/reminder/{reminderId}
File Address without Tile/core/home/{sideDrawerId}/my-sd/records/view/{recordId}/file/{fileId}
File Address with Tile/core/home/{sideDrawerId}/my-sd/records/{recordType}/view/{recordId}/file/{fileId}

Console Route options:

DescriptionPath
Update Info Request (Plan)/core/home/{sideDrawerId}/plans/plan/{planId}
List Items of Info Request/core/home/{sideDrawerId}/plans/plan/{planId}/items
Preview Info Request/core/home/{sideDrawerId}/plans/plan/{planId}/preview
Blast Delivery/core/home/{sideDrawerId}/blast-delivery
Edit Template for Blast Delivery/core/home/{sideDrawerId}/template/{templateId}