diff --git a/src/types/messages.ts b/src/types/messages.ts index 94d164c..aeb5861 100644 --- a/src/types/messages.ts +++ b/src/types/messages.ts @@ -251,7 +251,7 @@ export type InteractiveMessageAction = { /** * Required for Call-to-Action URL Button Messages. */ - url?: string; + url?: string; /** * Optional for Flows Messages. * diff --git a/src/types/webhooks.ts b/src/types/webhooks.ts index c3936ca..4ffd9ee 100644 --- a/src/types/webhooks.ts +++ b/src/types/webhooks.ts @@ -48,7 +48,7 @@ export type WebhookMessage = { /** * The type of message that has been received by the business that has subscribed to Webhooks. */ - type: MessageType | "system" | "unknown"; + type: MessageType | "system" | "unknown" | "request_welcome"; /** * The time when the customer sent the message to the business in unix format */ @@ -70,6 +70,49 @@ export type WebhookMessage = { payload: string; text: string; }; + /** + * When the messages type field is set to contact, this object is included in the messages object: + */ + contacts?: [ + { + addresses?: { + city?: string; + country?: string; + country_code?: string; + state?: string; + street?: string; + type?: string; + zip?: string; + }[]; + birthday?: string; + emails?: { + email: string; + type?: string; + }[]; + name?: { + formatted_name?: string; + first_name?: string; + last_name?: string; + middle_name?: string; + suffix?: string; + prefix?: string; + }; + org?: { + company?: string; + department?: string; + title?: string; + }; + phones?: { + phone: string; + wa_id?: string; + type?: string; + }[]; + urls?: { + url: string; + type?: string; + }[]; + }, + ]; /** * Context object. Only included when a user replies or interacts with one of your messages. Context objects can have the following properties */ @@ -163,11 +206,21 @@ export type WebhookMessage = { * Sent when a user submits a flow */ nfm_reply?: { - body: string; - name: string; - response_json: string; + body: string; + name: string; + response_json: string; }; }; + /** + * When the messages type field is set to location, this object is included in the messages object: + */ + location?: { + latitude: string; + longitude: string; + name?: string; + address?: string; + }; + /** * Included in the messages object when a customer has placed an order. Order objects have the following properties: */