Registering Chats

Prerequisites

To call MedChat API to register a chat, first obtain your organization's OrgId and Access Token, as described in the API Authentication documentation.

Call the Register Chat Endpoint

API documentation for the register chat endpoint can be found here.

The call is an authenticated POST to https://medchatapp.com/livechatapi/orgs/{orgId}/registeredChats, with the following example request body:

{
    "widgetId": "8588E546-724D-40B9-AC61-2B31EE9AF4EB",
    "widgetTopicId": "D3828CBE-52BE-4CBB-81ED-A1524F2BADA2",
    "patientName": "Jane Doe",
    "patientSmsNumber": "2175555555",
    "patientEmailAddress": "[email protected]",
    "securityQuestion1": "Mother's maiden name?",
    "securityAnswer1": "Johnson",
    "securityQuestion2": null,
    "securityAnswer2": null,
    "registrationValidDuration": "30.00:00:00", // 30 days max
    "properties": {
        "DateOfBirth": "1980-01-01",
        "Hometown": "Springfield",
        "IsMarried": "True"
    }
}

Request body properties:

  • widgetId, widgetTopicId - The IDs of the widget and topic that will handle the registered chat.
  • patientName - The patient name.
  • patientSmsNumber - If provided, will be available as a 2FA method for verifying the patient.
  • patientEmailAddress - If provided, will be available as a 2FA method for verifying the patient.
  • securityQuestion1, securityAnswer1, securityQuestion2, securityAnswer2 - If provided, will be available as a 2FA method for verifying the patient.
  • registrationValidDuration - Timespan for which the registered chat will be valid.
  • properties - Dictionary of properties to register for this chat.

The response body will resemble the following:

{
    "referenceCode": "YP6XQEH4",
    "registeredChatId": "EF78D1AF-2770-412A-9842-0DE64DA6C3D6"
}

Response body properties:

  • referenceCode - The unique code that can be used to build a chat invite URL to this registered chat.
  • registeredChatId - The ID of the registered chat, that can be used to retrieve the registered chat from the MedChat API.

Retrieve an Existing Registered Chat

If you need to retrieve a previously registered chat, you can do so using the registeredChatId returned in the response of the register chat call.

Issue an authenticated GET request to https://medchatapp.com/livechatapi/orgs/{orgId}/registeredChats/{registeredChatId}.

API documentation for the get registered chat endpoint can be found here.