Embedded Content

From ContactsLaw Documentation

ContactsLaw allows subscribers to extend the appearance and functionality of their subscription with embedded content. This is a simple (but powerful) mechanism that makes external web-based content available within ContactsLaw, pre-filled with information about the resource (matter, contact, etc) from which it was launched.

In the case of the Desktop App, this content is displayed using an embedded web browser (Microsoft Edge WebView2).

Embedded content can be used to integrate with (including, but not limited to):

  • Customised reports/dashboards
  • Online booking/payment gateways
  • Third-party web applications

Properties

Embedded content has the following properties:

  • Caption for navigation purposes (in the Desktop App, this is displayed in the navigation pane)
  • Description (used on tooltips)
  • Uniform Resource Identifier (URI) of the external content
  • Scope from which the content will be accessible (matter, contact, etc)
  • Business or workgroup used to limit the availability of the content

URIs

When navigating to external content, ContactsLaw will append a set of key/value pairs to the query portion of the URI:

  • resourceType - Name of the model class (resource) from which the content was launched. This corresponds to the scope of the content.
  • resourceId - Unique identifier of the resource from which the content was launched.
  • tenantId - Globally unique identifier (GUID) of the subscription from which the request originated.
  • companyId - Unique identifier of the business from which the request originated.

This information allows external web applications to call the REST API in respect of the resource; for example, to pre-fill an online payment form with the matter code.

Authentication

When the scheme of the URI is https, ContactsLaw will include authentication headers in the request. This allows external web applications to perform operations in the context of the current user, as well as avoiding the need to prompt for credentials.

For this reason, you should ONLY add external content that you trust or have direct control over.

Push Notifications

Embedded content can also register to be updated (refreshed) when push notifications are received by ContactsLaw.

This is achieved by including the X-ContactsLaw-NotificationSubscription header in the response. The content for the header is a JSON object that describes which push notifications should trigger an update. The header can be included multiple times to subscribe to different notifications.

For example:

X-ContactsLaw-NotificationSubscription: {
   TenantId: "BF87739C-F140-44E2-A486-2BC53EE09507",
   ResourceType: "ContactsLaw.Models.Matters.Matter",
   ResourceId: 1234
}