Skip to content

Commit

Permalink
Merge pull request #126 from mobtexting/bugfix-M0-5695-tag-enhancement
Browse files Browse the repository at this point in the history
fix: tag enhancement
  • Loading branch information
sankarsuda authored Feb 13, 2024
2 parents 5b971ab + 56f1c1e commit 77cf457
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"auth_template_alias_name\",\n \"language\": \"en\",\n \"body_params\" : [\"replace-variable-code\"]\n }\n }\n}"
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"auth_template_alias_name\",\n \"language\": \"en\",\n \"body_params\" : [\"replace-variable-code\"]\n }\n }\n}"
},
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
Expand All @@ -37,4 +37,4 @@
"send"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"document\",\n \"payload\": {\n \"url\": \"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\n \"filename\": \"Sample PDF file\"\n }\n },\n \"body_params\": []\n }\n }\n}"
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"document\",\n \"payload\": {\n \"url\": \"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\n \"filename\": \"Sample PDF file\"\n }\n },\n \"body_params\": []\n }\n }\n}"
},
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"image\",\n \"payload\": {\n \"url\": \"https://picsum.photos/id/237/200/300\"\n }\n },\n \"body_params\": []\n }\n }\n}"
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"image\",\n \"payload\": {\n \"url\": \"https://picsum.photos/id/237/200/300\"\n }\n },\n \"body_params\": []\n }\n }\n}"
},
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"video\",\n \"payload\": {\n \"url\": \"https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4\"\n }\n },\n \"body_params\": []\n }\n }\n}"
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"video\",\n \"payload\": {\n \"url\": \"https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4\"\n }\n },\n \"body_params\": []\n }\n }\n}"
},
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"text\",\n \"payload\": {\n \"text\": \"replace-header-variable-value\"\n }\n },\n \"body_params\": [\"variable-1\", \"variable-2\"]\n }\n }\n}"
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": [\n \"{{receiver}}\"\n ]\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\",\n \"header_params\": {\n \"type\": \"text\",\n \"payload\": {\n \"text\": \"replace-header-variable-value\"\n }\n },\n \"body_params\": [\"variable-1\", \"variable-2\"]\n }\n }\n}"
},
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\"\n }\n ],\n \"recipient\": {\n \"to\": \"{{receiver}}\"\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\"\n }\n }\n}"
},
"raw": "{\n \"channels\": [\n {\n \"name\": \"whatsapp\",\n \"from\": \"{{from}}\",\n \"meta\": {\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ]\n }\n }\n ],\n \"recipient\": {\n \"to\": \"{{receiver}}\"\n },\n \"message\": {\n \"type\": \"template\",\n \"payload\": {\n \"name\": \"template_alias_name\",\n \"language\": \"en\"\n }\n }\n}" },
"url": {
"raw": "{{endpoint}}/api/v2/whatsapp/message/send",
"host": [
Expand Down
5 changes: 4 additions & 1 deletion v2/rcs/send-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"name": "rcs",
"from": "700969ca-0cb2-11ec-a2cxxxx", //Agent ID
"meta" : {
"foreign_id":"your-custom-id"
"foreign_id":"your-custom-id",
"tags": ["tag1", "tag2"]
}
}]
"recipient": {
Expand Down Expand Up @@ -49,6 +50,8 @@
| recipient | This block contains contacts information related to channel | N/A | Yes |
| group_id | Segment id which contain list of phone numbers | `string` or `array` | Yes if `to` param not present |
| to | Receiver mobile numbers : `text` | `array` | Yes, if `group_id` not present |
| meta | This block contains all the optional parameters | `object` | No |
| tags | opt-out the message based on the tags. | `string` | No |

`Note` : The `recipient` block inside channel is related to particular communication channel and it is optional. The outside `recipient` channel contain common recipients for every channel.

Expand Down
4 changes: 3 additions & 1 deletion v2/sms/sendsms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"template_id": "1234XXXXXXX",
"entity_id":"89XXXXXXXXXXX",
"foreign_id":"your-custom-id",
"type":"U"
"type":"U",
"tags": ["tag1", "tag2"]
}
}],
"recipient": {
Expand Down Expand Up @@ -66,6 +67,7 @@
| template_id | DLT registered template id. | `int` | No (applicable for indian routes only) |
| entity_id | DLT registered entity id. | `int` | No (applicable for indian routes only) |
| max_units | The maximum number of units to be sent in the message ex:(value 2 or 3) | `int` | No |
| tags | opt-out the message based on the tags. | `string` | No |

`Note` : The `recipient` block inside channel is related to particular communication channel and it is optional. The outside `recipient` channel contain common recipients for every channel.

Expand Down
7 changes: 5 additions & 2 deletions v2/viber/send-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
| name | Name of Messaging Channel. Ex: `viber` | `string` | Yes |
| from | Commercial Account Id | `string` | Yes |
| recipient | This block contains contacts information related to channel | N/A | Yes |
| meta | This block contains category information related to message type | N/A | Yes |
| meta | This block contains category information related to message type and additional information | N/A | Yes |
| category | `transactional` or `promotional` | `string` | Yes |
| ttl | If TTL value is set it should be min 30 to max 1,209,600 seconds | `string` | No |
| group_id | Segment id which contain list of phone numbers | `string` or `array` | Yes if `to` param is not present |
| to | Receiver mobile numbers | `array` | Yes, if `group_id` is not present |
| tags | opt-out the message based on the tags. | `string` | No |


`Note` : The `recipient` block inside channel is related to particular communication channel and it is optional. The outside `recipient` channel contain common recipients for every channel.

Expand All @@ -28,7 +30,8 @@
"meta": {
"category": "category",
"foreign_id": "your-custom-id",
"ttl": 60
"ttl": 60,
"tags": ["tag1", "tag2"]
}
}
],
Expand Down
4 changes: 3 additions & 1 deletion v2/whatsapp/send-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| recipient | This block contains contacts information related to channel | N/A | Yes |
| foreign_id | Custom id for reference from customer. | `string` | No |
| group_id | Segment id which contain list of phone numbers | `string` or `array` | Yes if `to` param not present |
| tags | opt-out the message based on the tags. | `string` | No |
| to | Receiver mobile numbers : `text` | `array` | Yes, if `group_id` not present |

`Note` : The `recipient` block inside channel is related to particular communication channel and it is optional. The outside `recipient` channel contain common recipients for every channel.
Expand All @@ -23,7 +24,8 @@
"name": "whatsapp",
"from": "91901912xxxx",
"meta" : {
"foreign_id":"your-custom-id"
"foreign_id":"your-custom-id",
"tags": ["tag1", "tag2"]
}
}]
"recipient": {
Expand Down
4 changes: 4 additions & 0 deletions v2/whatsapp/send-meta-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
| body_params | Up to 1024 characters for all parameters that are predefined template text, if `authentication` template has only one replace variable value. | Up to 1024 characters for all parameters and predefined template text | Yes incase only template contain having the body variables |
| components | This block contains header, body, footer sections payload as per predefined template. | Up to 1024 characters for all parameters and predefined template text | Yes incase Template contain headers and footers |
| ttl | Time to live of the template message. If the receiver has not opened the template message before the time to live expires, the message will be deleted. Default 30 Days. Need to specify in Seconds | Can be more than 1 day i.e 86400 sec | No |
| meta | This block contains all additional information | N/A | No |
| tags | opt-out the message based on the tags. | N/A | No |



## Example Request For Non-variable Template

Expand Down

0 comments on commit 77cf457

Please sign in to comment.