cURL kullanarak WhatsApp API Nasıl Gönderilir

Giriş

Bu kod parçacığında, CURL kullanarak bir WhatsApp API’sini nasıl göndereceğinizi, bir metin mesajı, WhatsApp Şablonları, medya, etkileşimli düğmeler, listeler, ürünler … vb göndermeyi öğreneceksiniz, Aşağıdaki kodları çalıştırmak için Alvochat hesabı gereklidir. Hesabınız yoksa bir Hesap oluşturun.

WhatsApp API kullanarak şablon gönderme

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/template \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'name=hello_world' \
 --data-urlencode 'language=en_us' \
 --data-urlencode 'header=' \
 --data-urlencode 'body=' \
 --data-urlencode 'buttons=' \
 --data-urlencode 'priority=' 

WhatsApp API kullanarak metin mesajı gönderme

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/chat \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'body=WhatsApp API on alvochat.com works good' \
 --data-urlencode 'priority=' \
 --data-urlencode 'preview_url=' \
 --data-urlencode 'message_id=' 

Resim gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/image \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'image=https://alvochat-example.s3-accelerate.amazonaws.com/image/1.jpeg' \
 --data-urlencode 'caption=image caption' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Ses gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/audio \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'audio=https://alvochat-example.s3-accelerate.amazonaws.com/audio/1.mp3' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Video gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/video \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'video=https://alvochat-example.s3-accelerate.amazonaws.com/video/1.mp4' \
 --data-urlencode 'caption=video caption' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Belge gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/document \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'document=https://alvochat-example.s3-accelerate.amazonaws.com/document/1.pdf' \
 --data-urlencode 'filename=' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Çıkartma gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/sticker \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'sticker=https://alvochat-example.s3-accelerate.amazonaws.com/sticker/1.webp' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

İletişim gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/contact \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'contact=' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Konum Gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/location \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'lat=37.484296' \
 --data-urlencode 'lng=-122.148703' \
 --data-urlencode 'address=Menlo Park, California, United States' \
 --data-urlencode 'name=Meta Headquarters' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Liste gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/list \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'header=header' \
 --data-urlencode 'body= please select one of the following options' \
 --data-urlencode 'footer=footer' \
 --data-urlencode 'button=options' \
 --data-urlencode 'sections=option_1,option_2,option_3' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Gönder düğmesi

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/button \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'header=header' \
 --data-urlencode 'body= please select one of the following options' \
 --data-urlencode 'footer=footer' \
 --data-urlencode 'buttons=option_1,option_2,option_3' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Ürün gönder

curl --request POST \
  --url https://api.alvochat.com/instance1199/messages/product \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=YourToken' \
 --data-urlencode 'to=16315555555' \
 --data-urlencode 'header=header' \
 --data-urlencode 'body=Hi , check out our new products' \
 --data-urlencode 'footer=footer' \
 --data-urlencode 'catalog_id=' \
 --data-urlencode 'product=' \
 --data-urlencode 'priority=' \
 --data-urlencode 'message_id=' 

Whatsapp API Dokümantasyonunun tamamını buradan görebilirsiniz.