Share Location Information

POST and GET Methods

Overview

Share your business-related location like nearest ATM, or a store from your WhatsApp account using API. To send the location information, you need to add latitude and longitude coordinates as additional parameters to the standard outbound WhatsApp API request.

To send location information

  1. Sign in to KCloud and create your API key.

Refer to the Create an API Key page for steps to create your API key. To view the API Key and the SID, see View API Key and SID.

📘

Note:

After you sign up, your account will be on the trial version. You need to complete the KYC to access all the features of KCloud.

  1. Send the location information

You can use the below API’s for the location information via WhatsApp account

POST

cURL -X POST "https://api.kaleyra.io/v1/<SID>/messages" \
     -H "Content-Type: <CONTENT_TYPE>" \
     -H "api-key:<API_KEY>" \
     -d "to=<TO_NUMBER>" \
     -d "type=<MESSAGE_TYPE>" \
     -d "param_lat=<LATITUDE GEO CO-ORDINATE>" \
     -d "channel=<CHANNEL_NAME>" \
     -d "from=<FROM_NUMBER>" \
     -d "callback_url=<CALLBACK_URL>"
     -d "param_long=<LONGITUDE GEO CO-ORDINATE>" \
     -d "param_name=<RECEIVER NAME>" \
     -d "param_address=<RECEIVER ADDRESS>" \

GET

curl --location --request GET 'https://api.kaleyra.io/v1/<SID>/messages?channel=<CHANNEL_NAME>&to=<TO_NUMBER>&from=<FROM_NUMBER>&type=<MESSAGE_TYPE>&param_lat=<LATITUDE GEO CO-ORDINATE>&param_long=<LONGITUDE GEO CO-ORDINATE>&param_name=<RECEIVER NAME>&param_address=<RECEIVER ADDRESS>' 
--header 'api-key:<API_KEY>'

Ensure that you replace the parameter values with the proper inputs in the above code. The below table has a list of parameters and their information.

ReplaceWithExampleRequired
SIDAccount SID (Security Identifier)HXXXXXXX071USYes
CONTENT_TYPEThe format in which the data is sent.application/x-www-form-urlencodedYes
API_KEYAPI Key generated by KCloud.Ac4XXXXX21fYes
TO_NUMBERA valid WhatsApp number of the recipient. Ensure that the country code is prefixed to the number. (E164 format).
  • *Note:** You can add multiple recipients separated by the comma.
+1202XXXXXXXYes
MESSAGE_TYPEFormat of the message.locationYes
LATITUDE GEO CO-ORDINATELatitude coordinate38.846439Yes
CHANNEL_NAMEChannel on which the message should be sent.WhatsAppYes
FROM_NUMBERThe WhatsApp business number registered with KCloud from which the message is to be sent. Ensure the number is prefixed with the country code. (E164 format).+1202XXXXXXXYes
CALLBACK_URLThe URL that KCloud should send information to when your number receives a response. This URL can be accessed publicly.https://webhook.site/89b43b12-b889-4f66-8ebf-3379b4b3345cOptional
LONGITUDE GEO CO-ORDINATELongitude coordinate-94.547432Yes
RECEIVER NAMEName of the receiver who receives the location informationJohnYes
RECEIVER ADDRESSAddress of the receiverLAYes
  1. Below is the response sample of both the GET and POST methods.

{
    "id": "794a85fa-3d92-4ca4-86df-f3459aacd128",
    "type": "location",
    "createdDateTime": "2020-10-06 08:57:22+00:00",
    "totalCount": 1,
    "data": [
        {
            "message_id": "794a85fa-3d92-4ca4-86df-f3459aacd128:0",
            "recipient": "91xxxxxxxxxx"
        }
    ],
    "error": {}
}
📘

Note:

In case of an error, ensure that the parameter values are correct in the above code. Refer to the Error Codes and their Description page for detailed information.




© 2026 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.