Description
Whenever a message is sent or received in Hi Marley (via webapp or API call), this webhook will send the specific message data plus customer, case and operator data as a JSON payload to a designated HTTP(s) address. If the message contains media, the message.data property will contain an AWS s3 link that is valid for 3600 seconds (one hour).
Hi Marley performs virus scanning for both inbound and outbound media. Any media flagged as potentially containing a virus will not be sent via webhook.
- Registering Webhook
- Request Payload
- Webhook Responses
- JSON Case Transcript Response Breakdown
- POST Payload Examples
Registering Webhook
Use the following payload to subscribe to this webhook using the POST /webhooks/register endpoint
Request Payload
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": 14,
"HTTP_POST_ADDRESS": "http://mywebaddress.com/himarleymessages",
"HEADERS": {
"headerName1": "headerValue1",
"headerName2": "headerValue2",
}
}Webhook Responses
Message Related Data Elements
messages.type - Indicates type of message received.
Options include:
- text - text message
- image - picture
- file - videos
- voice transcription - visual voicemail
message.channelSource - Indicates where message came from
Options include:
- marley - operator in webapp
- ai - non-operator in webapp
- mobile - customer texting
message.channel - the communication channel
Options include:
- voice
- text
POST Payload Examples
Enduser/Insured Sends Message
"caseData": {
"brand": "Hi Marley",
"claimNumber": "12123515",
"dateOfLoss": "2021-07-23T16:00:00.000Z",
"id": "(Case ID - Unique)",
"archived": false
},
"state": "open",
"caseType": "claim",
"customer": {
"id": "(Customer ID - Unique)",
"first": "Smith",
"last": "John",
"email": "customer8013@testemail.com",
"mobile": "+555555555",
"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-07-30T19:38:51.744Z",
"referenceId": "12123515",
"privacy": "public",
"messages": [
{
"id": "(Message ID - Unique)",
"type": "text (text, image, file)",
"formatting": "standard",
"data": "hello",
"channelSource": "mobile (mobile, marley)",
"channel": "text",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "Smith",
"lastName": "John"
}
},
"createdAt": "2021-08-12T15:18:51.580Z",
"dateFormatted": "08-12-2021",
"timeFormatted": "11:18:51 AM EDT"
}
]
} Hi Marley Operator/Carrier Employee Sends Message
"caseData": {
"brand": "Hi Marley",
"claimNumber": "12123515",
"dateOfLoss": "2021-07-23T16:00:00.000Z",
"id": "(Case ID - Unique)",
"archived": false
},
"state": "open",
"caseType": "claim (claim, case, policy)",
"customer": {
"id": "(Customer ID - Unique)",
"first": "Smith",
"last": "John",
"email": "customer8013@testemail.com",
"mobile": "+555555555",
"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-07-30T19:38:51.744Z",
"referenceId": "12123515",
"privacy": "public",
"messages": [
{
"id": "(Message ID - Unique)",
"type": "text (text, image, file)",
"formatting": "standard",
"data": "hello",
"channelSource": "marley (mobile, marley)",
"channel": "text",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "Carrier",
"lastName": "Adjuster"
}
},
"createdAt": "2021-08-12T15:16:55.550Z",
"dateFormatted": "08-12-2021",
"timeFormatted": "11:16:55 AM EDT"
}
]
}User Sends Image
"caseData": {
"brand": "Hi Marley",
"claimNumber": "12123515",
"dateOfLoss": "2021-07-23T16:00:00.000Z",
"id": "(Case ID - Unique)",
"archived": false
},
"state": "open",
"caseType": "claim (claim, case, policy)",
"customer": {
"id": "(Customer ID - Unique)",
"first": "Smith",
"last": "John",
"email": "customer8013@testemail.com",
"mobile": "+555555555",
"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-07-30T19:38:51.744Z",
"referenceId": "12123515",
"privacy": "public",
"messages": [
{
"id": "(Message ID - Unique)",
"type": "text (text, image, file)",
"formatting": "standard",
"data": "[Link to Customer Image/Media via Hi Marley Generated Link]",
"channelSource": "mobile (mobile, marley)",
"channel": "text",
"author": {
"_id": "(Customer or Primary Contact ID - Unique)",
"profile": {
"firstName": "John",
"lastName": "Smith"
}
},
"createdAt": "2021-08-12T15:18:55.550Z",
"dateFormatted": "08-12-2021",
"timeFormatted": "11:18:55 AM EDT"
}
]
}
Hi Marley Inbound Voicemail Message
{
"caseData": {
"id": "0b2711a8-a95f-4909-8a61-ccc20e9f6bca",
"reference": "d2194eaa-5d54-47fe-a4ca-33908b571837"
},
"state": "open",
"caseType": "case",
"customer": {
"id": "92efd2c1-44a3-4406-9284-2ac4b726b8a7",
"first": "Test",
"last": "Enduser",
"email": "foo-bar-5f30dbec-1366-4b4b-bb60-6cd50005d394@himarley.com",
"mobile": "+15550762376",
"role": "enduser",
"optStatus": true,
"optStatusDetail": "OPTED_IN"
},
"primaryContact": {
"id": "c1238bb7-5c76-4a36-84b5-a100679ecf3a",
"first": "Operator",
"last": "End2end",
"email": "operator1@e2eorg.com",
"mobile": "+15559990001",
"role": "operator"
},
"createdBy": {
"id": "dd84324d-8e3e-4b58-bba1-162a8239ed2d",
"first": "Admin1",
"last": "End2EndTestUser",
"email": "admin1@e2eorg.com",
"mobile": "+15559990000",
"role": "operator"
},
"createTime": "2024-10-07T18:57:54.225Z",
"creationSource": "WebApp",
"referenceId": "d2194eaa-5d54-47fe-a4ca-33908b571837",
"privacy": "public",
"marleyNumber": "+15557569919",
"languagePreference": "en",
"secondaryOperators": [],
"messages": [
{
"id": "VOICE-94356b0f-eff7-47b1-9832-38576dbdbeaa",
"type": "voice transcription",
"formatting": "standard",
"data": "Bonjour, comment ça va?",
"channelSource": "mobile",
"channel": "voice",
"author": {
"_id": "92efd2c1-44a3-4406-9284-2ac4b726b8a7",
"profile": {
"firstName": "Test",
"lastName": "Enduser"
},
"role": "enduser"
},
"createdAt": "2024-10-07T18:57:56.365Z",
"dateFormatted": "10-07-2024",
"timeFormatted": "2:57:56 PM EDT",
"translations": [
{
"translatedMessage": "Hello, how are you?",
"sourceLanguage": "fr",
"destinationLanguage": "en"
}
]
}
]
}
Comments
0 comments
Please sign in to leave a comment.