Skip to content

Commit

Permalink
feat: add Context on WhatsApp messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Jun 26, 2024
1 parent 79ebe28 commit 426ef47
Show file tree
Hide file tree
Showing 35 changed files with 739 additions and 277 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"channel": "whatsapp",
"message_type": "audio",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"audio": {
"url": "https://test.com/voice.mp3"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"channel": "whatsapp",
"message_type": "custom",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"custom": {
"type": "template",
"template": {
"something": "whatsapp:hsm:technology:nexmo",
"name": "parcel_location"
}
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"channel": "whatsapp",
"message_type": "file",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"file": {
"url": "https://test.com/me.txt",
"caption": "Me"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"channel": "whatsapp",
"message_type": "image",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"image": {
"url": "https://test.com/image.png",
"caption": "Testing image caption"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"channel": "whatsapp",
"message_type": "custom",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"custom": {
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "Our top products"
},
"body": {
"text": "Check out these great products"
},
"footer": {
"text": "Sale now on!"
},
"action": {
"catalog_id": "catalog_1",
"sections": [
{
"title": "Cool products",
"product_items": [
{
"product_retailer_id": "product_1"
},
{
"product_retailer_id": "product_2"
}
]
},
{
"title": "Awesome products",
"product_items": [
{
"product_retailer_id": "product_3"
}
]
}
]
}
}
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"channel": "whatsapp",
"message_type": "custom",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"custom": {
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "Check out this cool product"
},
"footer": {
"text": "Sale now on!"
},
"action": {
"catalog_id": "catalog_1",
"product_retailer_id": "product_1"
}
}
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"channel": "whatsapp",
"message_type": "sticker",
"to": "447700900000",
"from": "447700900001",
"client_ref": "string",
"sticker": {
"id": "aabb7a31-1d1f-4755-a574-2971d831cd5b"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"channel": "whatsapp",
"message_type": "sticker",
"to": "447700900000",
"from": "447700900001",
"client_ref": "string",
"sticker": {
"url": "https://example.com/image.webp"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"channel": "whatsapp",
"message_type": "template",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"whatsapp": {
"policy": "deterministic",
"locale": "en-GB"
},
"template": {
"name": "Amazing template",
"parameters": [
{
"default": "Vonage Verification"
},
{
"default": "64873"
},
{
"default": "10"
}
]
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"channel": "whatsapp",
"message_type": "text",
"text": "Hello mum",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"channel": "whatsapp",
"message_type": "video",
"to": "441234567890",
"from": "015417543010",
"client_ref": "abcdefg",
"video": {
"url": "https://test.com/me.mp4",
"caption": "Me at the zoo"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
}
}
Loading

0 comments on commit 426ef47

Please sign in to comment.