CURL ile WhatsApp API’si Nasıl Gönderilir

Bu eğitimde, CURL kullanarak bir WhatsApp API Göndereceğiz, Komut satırında çalıştırabilir, isteği Postman APP’ye aktarabilir veya isteği başka bir programlama dilinden gönderebilirsiniz.

cURL kullanan ilk WhatsApp mesajı

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/chat \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'body=WhatsApp API on UltraMsg.com works good' \
  --data 'priority=10' \
  --data 'referenceId='

Resim Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/image \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'image=https://file-example.s3-accelerate.amazonaws.com/images/test.jpg' \
  --data 'caption=image Caption' \
  --data 'referenceId='

Belge Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/document \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'filename=hello.pdf' \
  --data 'document=https://file-example.s3-accelerate.amazonaws.com/documents/cv.pdf' \
  --data 'referenceId='

Ses Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/audio \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'audio=https://file-example.s3-accelerate.amazonaws.com/audio/2.mp3' \
  --data 'referenceId='

Ses Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/voice \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'audio=https://file-example.s3-accelerate.amazonaws.com/voice/oog_example.ogg' \
  --data 'referenceId='

Video Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/video \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'video=https://file-example.s3-accelerate.amazonaws.com/video/test.mp4' \
  --data 'referenceId='
curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/link \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'link=https://en.wikipedia.org/wiki/COVID-19' \
  --data 'referenceId='

Kişi Gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/contact \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data '[email protected]' \
  --data 'referenceId='

Konum göndermek

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/location \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'address=ABC company \n Sixth floor , office 38' \
  --data 'lat=25.197197' \
  --data 'lng=55.2721877' \
  --data 'referenceId='

Vcard gönder

curl --request POST \
  --url https://api.ultramsg.com/instance1316/messages/vcard \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'token=token123' \
  --data 'to=14155552671' \
  --data 'vcard= BEGIN:VCARD\nVERSION:3.0\nN:lastname;firstname\nFN:firstname lastname\nTEL;TYPE=CELL;waid=14000000001:14000000002\nNICKNAME:nickname\nBDAY:01.01.1987\nX-GENDER:M\nNOTE:note\nADR;TYPE=home:;;;;;;\nADR;TYPE=work_:;;;;;;\nEND:VCARD' \
  --data 'referenceId='

son olarak, Tam Whatsapp API Belgelerini ve SSS’yi görebilirsiniz.