diff --git a/handlers/dialog360/handler.go b/handlers/dialog360/handler.go index 29fc0b07f..8f946f525 100644 --- a/handlers/dialog360/handler.go +++ b/handlers/dialog360/handler.go @@ -27,7 +27,7 @@ const ( var ( // max for the body - maxMsgLength = 1000 + maxMsgLength = 4096 ) func init() { diff --git a/handlers/dialog360/handler_test.go b/handlers/dialog360/handler_test.go index d949d5898..b2e8083ed 100644 --- a/handlers/dialog360/handler_test.go +++ b/handlers/dialog360/handler_test.go @@ -432,7 +432,7 @@ var SendTestCasesD3C = []OutgoingTestCase{ }, }, ExpectedRequests: []ExpectedRequest{{ - Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","sub_type":"","index":"","parameters":[{"type":"text","text":"Chef"},{"type":"text","text":"tomorrow"}]}]}}`, + Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","parameters":[{"type":"text","text":"Chef"},{"type":"text","text":"tomorrow"}]}]}}`, }}, ExpectedExtIDs: []string{"157b5e14568e8"}, }, diff --git a/handlers/meta/whataspp_test.go b/handlers/meta/whataspp_test.go index 1baf97a94..e55b50c7f 100644 --- a/handlers/meta/whataspp_test.go +++ b/handlers/meta/whataspp_test.go @@ -401,7 +401,7 @@ var whatsappOutgoingTests = []OutgoingTestCase{ }, }, ExpectedRequests: []ExpectedRequest{{ - Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","sub_type":"","index":"","parameters":[{"type":"text","text":"Chef"},{"type":"text","text":"tomorrow"}]}]}}`, + Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","parameters":[{"type":"text","text":"Chef"},{"type":"text","text":"tomorrow"}]}]}}`, }}, ExpectedExtIDs: []string{"157b5e14568e8"}, }, @@ -456,7 +456,7 @@ var whatsappOutgoingTests = []OutgoingTestCase{ }, }, ExpectedRequests: []ExpectedRequest{{ - Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","sub_type":"","index":"","parameters":[{"type":"text","text":"Ryan Lewis"},{"type":"text","text":"niño"}]},{"type":"button","sub_type":"quick_reply","index":"0","parameters":[{"type":"payload","payload":"Sip"}]},{"type":"button","sub_type":"quick_reply","index":"1","parameters":[{"type":"text","text":"id00231"}]}]}}`, + Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"template","template":{"name":"revive_issue","language":{"policy":"deterministic","code":"en_US"},"components":[{"type":"body","parameters":[{"type":"text","text":"Ryan Lewis"},{"type":"text","text":"niño"}]},{"type":"button","sub_type":"quick_reply","index":"0","parameters":[{"type":"payload","payload":"Sip"}]},{"type":"button","sub_type":"quick_reply","index":"1","parameters":[{"type":"text","text":"id00231"}]}]}}`, }}, ExpectedExtIDs: []string{"157b5e14568e8"}, }, diff --git a/handlers/meta/whatsapp/api.go b/handlers/meta/whatsapp/api.go index 2bca2a0b1..5a36d008b 100644 --- a/handlers/meta/whatsapp/api.go +++ b/handlers/meta/whatsapp/api.go @@ -155,8 +155,8 @@ type Param struct { type Component struct { Type string `json:"type"` - SubType string `json:"sub_type"` - Index string `json:"index"` + SubType string `json:"sub_type,omitempty"` + Index string `json:"index,omitempty"` Params []*Param `json:"parameters"` }