Send Flow Message

Use this API to send message with a flow.

Request Parameters

Key

Description

Value

Data type

Required/Optional

Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

  • The Id should be a valid app Id of Gupshup. - The App must be associated with the account that owns the PARTNER_APP_TOKEN being used

messaging_product

Messaging product

whatsapp

String

Required

recipient_type

Recipient type

individual

String

Required

to

Destination phone no

where themessageneed to besend

91785876xxxx

String

Required

Must be a valid phone number

type

Messaging type

text

String

Required

Type should be a template to send template message.

template

Template message inside body

"template":

{"name": "Template"......}

object

Required

Key should be a template to send template message.

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/<APP_ID>/v3/message' \
--header 'Authorization: <PARTNER_APP_TOKEN>' \
--header 'Content-Type: application/json' \
--data '
{
	"name": "example_template_name",
	"language": "en_US",
	"category": "MARKETING",
	"components": 
	[
		{
			"type": "body",
			"text": "This is a flows as template demo"
		},
		{
			"type": "BUTTONS",
			"buttons": 
			[
				{
					"type": "FLOW",
					"text": "Sign up",
					"flow_action": "navigate",
					"navigate_screen": "WELCOME_SCREEN"
					"flow_json" : "
					{ \"version\": \"3.1\", \"screens\": 
						[ 
							{ \"id\":\"WELCOME_SCREEN\", \"layout\": 
								{ \"type\": \"SingleColumnLayout\",\"children\": 
									[ 
										{ \"type\": \"TextHeading\",\"text\": \"Hello World\" 
										}, 
										{ \"type\":\"TextBody\", \"text\": \"Let\'s start building things!\" 
										},
										{ \"type\": \"Footer\", \"label\": \"Complete\",\"on-click-action\": 
											{ \"name\": \"complete\",\"payload\": {} } 
										} 
									] 
								},
									\"title\": \"Welcome\", \"terminal\": true, \"success\": true, \"data\": {}
							} 
						]
					}
				}
			]
		}
	]
}'

Sample Response

{
	"messages": 
	[
		{
			"id": "GUPSHUP_MESSAGE_ID"
		}
	],
	"messaging_product": "whatsapp",
	"contacts": 
	[
		{
			"input": "DESTINATION_PHONE_NO",
			"wa_id": "DESTINATION_PHONE_NO"
		}
	]
}

Status Codes

Status Code

Response

Comments

Success

200

{

"messages":[{"id": "GUPSHUP_MESSAGE_ID"} ], "messaging_product": "whatsapp", "contacts": [ { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ] }

Error

400

{

"message": "Callback Billing must be enabled for this API",
"status": "error"}

if Callback billing is not enabled for the app

400

{
"message": "Invalid App Details", "status": "error"}

if app details are not found

401

{

"status": "error",
"message": "Authentication Failed"}

When API key authentication fails

Language
Click Try It! to start a request and see the response here!