Send Location Message via WhatsApp Instance
POST
/v1/instance/{{INSTANCE_ID}}/message/send/locationThis API allows sending a location message through a specific WhatsApp instance. The location can be sent to a recipient’s phone number along with a name, address, and an optional URL to provide additional context.
Request Parameters
Path Parameters
instance_id
(string) - The unique identifier of the WhatsApp instance. Replacecaaq85kdxw
with your actual instance ID.
Headers
Authorization
(string, required) - Bearer token for authentication. Replace{{ZAPLY_AUTH_TOKEN}}
with your API token.Content-Type
(string, required) - Specifies that the request body is in JSON format. Useapplication/json
.
Request Body
The body should be in JSON format and include the following parameters:
latitude
(float, required) - Latitude of the location.- Example:
48.8583701
- Example:
longitude
(float, required) - Longitude of the location.- Example:
2.2944813
- Example:
number
(string, required) - The phone number of the recipient, including the country code.- Example:
"918367875645"
- Example:
name
(string, optional) - The name of the location.- Example:
"Eiffel Tower"
- Example:
address
(string, optional) - Descriptive address of the location.- Example:
"Av. Gustave Eiffel, 75007 Paris, France"
- Example:
url
(string, optional) - A URL link for more information about the location.- Example:
"https://www.toureiffel.paris/en"
- Example:
Example JSON Request Body:
{
"latitude": 48.8583701,
"longitude": 2.2944813,
"number": "918367875645",
"name": "Eiffel Tower",
"address": "Av. Gustave Eiffel, 75007 Paris, France",
"url": "https://www.toureiffel.paris/en"
}
Error Codes
400 Bad Request
- Invalid input parameters (e.g., missing required fields).401 Unauthorized
- Invalid or missingAuthorization
token.404 Not Found
- Instance ID does not exist.500 Internal Server Error
- Server encountered an unexpected condition.
Request
{
"latitude": 48.8583701,
"longitude": 2.2944813,
"number": "918147069203",
"name": "Eiffel Tower",
"address": "Av. Gustave Eiffel, 75007 Paris, France",
"url": "https://www.toureiffel.paris/en"
}
Request samples
Responses
{}