Webhooks
Lending

Register for webhooks

1min
base address sandbox api https //lendingsandbox crbcos com/ production api https //lending crbcos com/ registrations can also be created, updated, and restarted via the cos lending hooks ui sandbox ui https //lendingappsandbox crbcos com/hooks/registrations production ui https //lendingapp crbcos com/hooks/registrations post /hooks/v2/registrations use this call to create a registration to hook events edit a hook registration restart a registration if it is suspended request url https // /hooks/v2/registrations editing a registration to edit an existing registration, use the same api endpoint as for creating a registration how it works include the id of the registration in the post request to modify an existing entry the api automatically determines whether to create or update a registration based on mplid hookname if a registration already exists for the given mplid/hookname combination, the api will update it instead of creating a new one if no matching registration is found, a new one will be created when editing a registration via the ui , any stored passwords or tokens will be shown hashed on the ui for security reasons, you will need to re enter these credentials when modifying the registration sample request in curl post /hooks/v2/registrations in the request below, hookname shows the event registered as loanstatusupdated curl location request post 'https //lendingsandbox crbcos com/hooks/v2/registrations' \\ \ header 'content type application/json' \\ \ header 'authorization bearer \<token>' \\ \ data raw '{ "id" null, "applicationname" "cos lending", "hookname" "loanstatusupdated", "hookcorrelationid" "your 3 letter mpl id", "options" { "hooktype" "web", "httpmethod" "post", "uri" "add your url here, that is specific to this event type", "headers" { "headername" \[ "loanstatusupdated" ] }, "authenticationoptions" { "authenticationtype" "none" } }, "suspended" false }' duplication registrations the default behavior for hooks registration, is to either create or update the registration based on the mplid and the hookname, assuming there is only one registration per combination of mplid/hookname in certain use cases, you might want to create two registrations for the same event for example, one web hook, and one email hook to do this, you need to supply a new guid for the id field of the registration webhook attributes attribute description id string this field can be null or populated with the registration guid for the registration null when creating a new registration guid when updating or unsuspending an existing registration applicationname string should always be cos lending hookname string the name of the hook you want to register for loanstatusupdated complianceloanfailed railupdated hookcorrelationid string 3 letter mpl id suspended boolean true or false true if the registration should be suspended and not send webhooks false if the registration should be active if you edit a suspended registration, false will restart the registration options object select the relevant values for the fields below options hooktype delivery method for the event (enum) select from web (for webhooks) email slack message (coming soon) rabbitmq (coming soon) sqs (coming soon) options httpmethod string post options uri string the url to receive webhook events/ options headers string array key/value pairs of headers and values each header can have an array of values "headers" { "firstheader" \[ "test1", "test2" ], "secondheader" \["single value"] } options authenticationoptions object authentication options for web hooks select from none basic oidc sample response in json post /hooks/v2/registrations use the id received in the response to update or restart the registration { "version" "2 0", "issuccessful" true, "statuscode" 200, "result" { "id" "eb62ffbd 7ed4 4146 be48 7f2a46551c0e", "applicationname" "cos lending", "hookname" "loanstatusupdated", } } webhooks without authentication "options" { "hooktype" "web", "httpmethod" "post", "uri" "add your url here, that is specific to this event type", "headers" { "headername" \[ "any header you want to add to all events" ] }, "authenticationoptions" { "authenticationtype" "none" } } webhooks with basic authentication "options" { "hooktype" "web", "httpmethod" "post", "uri" "add your url here, that is specific to this event type", "headers" { "headername" \[ "any header you want to add to all events" ] }, "authenticationoptions" { "authenticationtype" "basic", "username" "yyy", "password" "1234" } } webhooks with oidc authentication openid connect using your own authentication authority oidc setup must be implemented first your oidc must be fully implemented in order to use hooks notifications with oidc authentication this includes setting up a discovery endpoint / well known/openid configuration "options" { "hooktype" "web", "httpmethod" "post", "uri" "add your url here, that is specific to this event type", "headers" { "headername" \[ "headervalue" ] }, "authenticationoptions" { "authenticationtype" "oidc", "authorityurl" "", "clientid" "", "clientsecret" "", "scope" "" } } slack hook registration hook events can also be sent to your slack channels to do this you must create a slack bot with permissions to write to a channel in your workspace retrieve the auth token of the slackbot add the slackbot to the slack channel that you wish to register register the channel to receive events on the cos lending hooks ui, or via the api payload below important registering to a slack channel is not recommended if automation is needed for complete automation, it is recommended to use "web" hooks instead { "id" null, "applicationname" "cos lending", "hookname" "loannoteadded", "hookcorrelationid" "your 3 letter mpl id", "options" { "hooktype" "slack", "authtoken" "your slack api bot token ", "channel" "the channel name you must also add your slack bot to this channel" }, "suspended" false } email hook registration hook events can also be sent to your email address, or group email address register the channel to receive events on the cos lending hooks ui, or via the api payload below important registering to receive events via email is not recommended if automation is needed for complete automation, it is recommended to use "web" hooks instead { "id" null, "applicationname" "cos lending", "hookname" "loannoteadded", "hookcorrelationid" "your 3 letter mpl id", "options" { "hooktype" "email", "to" \[ "email address" ], "cc" \[ null ], "bcc" \[ null ] }, "suspended" false } testing webhook registration to test registering webhooks, configure a url for the specific event you are registering to if a url is not yet available, then you can use the webhook site as a temporary test solution follow these instructions to test the webhooks to register your url to receive webhook events go to https //webhook site/ click new on the top menu the site returns your unique url copy to clipboard your unique url if you already have other webhooks registered, the browser might automatically direct you to the url you've used 4 paste the copied url into the options uri field of the json body 5 send the registration api call with hook type "web" to register for webhooks the response field result id is the registrationid of the event you can find the registration id with the call get hooks/v2/registrations repeat the process for each event that you want to register for