How to Receive Notification Through Web Hook


Create REST POST API to Receive Notifications

Anyone who wants to receive web hook notification needs to create Restful POST API and have it accessible through the network.

  1. Below are the details to create this API:

    1. Method Type must be POST

    2. ContentType must be application/json via header value

    3. Body request : 

{

    "CompanyId": "00000000-0000-0000-0000-000000000000",

    "UserId": "string",

    "Priority": "string",

    "TimeStamp": "0001-01-01T00:00:00",

    "Expiration": "0001-01-01T00:00:00",

    "Type": "string",

    "MessageFormat": "string",

    "Message": {

        "Key1": "Value1",

        "Key2": 10

    },

    "MessageTemplate": "string"

}

Below are request parameter name and data type :

Parameter Name

Parameter Type

CompanyId

Guid

UserId

Guid

Priority

String

TimeStamp

DateTime

Expiration

DateTime

Type

String

MessageFormat

String

Message

Dictionary<string, object>

MessageTemplate

String


Set Webhook URL in preference Through Admin Portal

After creating webhook API, User needs to tell admin portal, where to send notifications. In order to do that, User need to go to User Preference section in Admin Portal and set this Url as shown below:

  1. Go to Flex CI Portal → User preference

    • Select "WebHook" method in delivery method name

    • Select "WebUrl" in delivery attribute

    • In "User Preference Value", provide the url on which the data needs to post( Url of the api to consume the webhook)

    • Once you click "Save", you will start receiving notifications from the system.
      Please note that you need to follow notificatoin template flow in order to generate notifications.