whatsapp-api
                                
                                 whatsapp-api copied to clipboard
                                
                                    whatsapp-api copied to clipboard
                            
                            
                            
                        Send Message Type Location
I need to send a location but I can't or I've done something wrong. How do I send a location using latitude and longitude?
In relation to your problem, this way I was able to send the location
{ 
  "chatId": "[email protected]", 
  "contentType": "Location", 
  "type": "location", 
  "latitude": 51.5074,
  "longitude": -0.1278,
  "name": "London",
  "address": "London, United Kingdom",
  "caption": "teste"
}
I've managed to send the latitude and longitude, but as well as not opening in the exact location, I can't assign the optional information such as name, url and description. Below is a sample of the output of the message sent via API (incomplete) and another sent via device (complete):
Via API:
- 
Code: { "chatId": "[email protected]", "contentType": "Location", "content": { "Location": { "latitude":-22.911632, "longitude":-43.578438, "name":"Craque do Pão", "url":"https://foursquare.com/v/5682faa2498e01df84e8efb8", "description":"Craque do Pão" } } }
- 
Output (webhook) {"latitude":-22.911632,"longitude":-43.578438,"description":""}
Via Device:
- Output (webhook)
{"latitude":-22.911632,"longitude":-43.578438,"name":"Craque do Pão","url":"https://foursquare.com/v/5682faa2498e01df84e8efb8","description":"Craque do Pão"}
Even if I reproduce the "content" with the same information that is sent by the device, the message is cut off as shown in the output above generated by sending via API.
- Enviada via Device: (description ok)
Good evening friend, could you help me, I had no success sending a PDF, do you have any examples to use and see how it is done, thank you in advance.
Hello friend!
I started using this API today and I haven't yet tried sending files (PDF), so I can't help you yet! Sorry!
In relation to your problem, this way I was able to send the location
I'll try it this way!
In relation to your problem, this way I was able to send the location
{ "chatId": "[email protected]", "contentType": "Location", "type": "document", "mimetype": "application/pdf", "caption": "teste", "content": "Localizacao" }
It didn't solve my case.
Hi, Allison, eu tb sou do BR, voce consegue usar essa api ? como que vc envia um texto simples para um numero ?
Olá @stonestecnologia !
Enviar mensagem é bem tranquilo. Pela interface do Swagger é como mostra no print abaixo:
Abaixo segue o modelo que uso em shell script para enviar mensagens:
O traço amarelo na imagem é o campo da API KEY.