Description
Whenever a case is closed via API or manually on the Hi Marley webapp, this webhook will post case transcript to a designated HTTP Address so that carriers can store the history of the SMS chat in any system that can parse JSON.
Registering Webhook
Use the following payloads to subscribe to send case data on case closure webhook using the POST /webhooks/register endpoint
Request Payloads
Note: The Headers array is a optional set of values that can be used to attach specific static headers to each webhook response for any purpose (e.g indicating the type of event, carrier authentication of payload with a token)
{
"EVENT_ID": 11,
"HTTP_POST_ADDRESS": "https://mywebaddress.com/transcripts",
"HEADERS": {
"key": "value",
"key1": "value1"
}
}
Example Request Triggered by Case Closure
Some Message Related Data Elements
messages.type - Indicates type of message received.
Options include
- text - text message
- image - picture
- file - document like a pdf files
message.channelSource - Indicates where message came from
Options include
- marley - operator in webapp
- mobile - customer texting
Headers
content-type application/jsonaccept application/json
requestid <auto-gen id>
<other subscribed headers>
Request Body
{
"caseData": {
"claimNumber": "ex-956472",
"dateOfLoss": "2021-10-01T16:00:00.000Z",
"brand": "Hi Marley",
"id": "(Case ID - Unique)"
},
"state": "closed",
"caseType": "claim",
"customer": {
"id": "(Customer ID - Unique)",
"first": "Jean-Luc",
"last": "Picard",
"email": "tester8013@testemail.com",
"mobile": "+15555555555",
"role": "enduser",
"optStatus": true,
"optStatusDetail": "OPTED_IN"
},
"primaryContact": {
"id": "(Primary Contact/Operator ID - Unique)",
"first": "Carrier",
"last": "Adjuster",
"email": "carrier.adjuster@carrier.org",
"role": "operator"
},
"createTime": "2021-09-08T17:35:08.934Z",
"referenceId": "1246852",
"privacy": "public",
"marleyNumber": "+18058769701",
"closedAt": "2022-02-24T21:14:20.751Z",
"languagePreference": "en",
"messages": [
{
"id": "(Message ID - Unique)",
"type": "text",
"formatting": "ai",
"data": "Hi Jean, thanks for reporting your policy #1246852. Your rep's name is Carrier Adjuster. You can contact them at carrier.adjuster@carrier.org",
"channelSource": "mobile",
"createdAt": "2021-09-08T17:35:09.446Z",
"dateFormatted": "09-08-2021",
"timeFormatted": "1:35:09 PM EDT"
},
{
"id": "(Message ID - Unique)",
"type": "text (text, image, file)",
"formatting": "standard",
"data": "hello",
"channelSource": "marley (mobile, marley)",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "Carrier",
"lastName": "Adjuster"
}
},
"createdAt": "2021-09-08T17:50:09.446Z",
"dateFormatted": "09-08-2021",
"timeFormatted": "1:50:34 PM EDT"
},
{
"id": "(Message ID - Unique)",
"type": "text (text, image, file)",
"formatting": "standard",
"data": "hello, Here is a picture of the accident",
"channelSource": "mobile (mobile, marley)",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "Picard",
"lastName": "Jean-Luc"
}
},
"createdAt": "2021-09-08T17:52:34.446Z",
"dateFormatted": "09-08-2021",
"timeFormatted": "1:52:34 PM EDT"
},
{
"id": "(Message ID - Unique)",
"type": "image (text, image, file)",
"formatting": "standard",
"data": "(Link to Customer Image/Media via Hi Marley Generated Link)",
"channelSource": "mobile (mobile, marley)",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "Picard",
"lastName": "Jean-Luc"
}
},
"createdAt": "2021-09-08T17:53:34.446Z",
"dateFormatted": "09-08-2021",
"timeFormatted": "1:53:34 PM EDT"
}
]
}
Comments
0 comments
Please sign in to leave a comment.