Bu doküman, WhatsApp API'sinin sunduğu endpoint'leri (servis noktalarını) ve işlevlerini basit bir dille açıklamaktadır.
Uygulamanın WhatsApp sunucularıyla olan temel bağlantı ve kimlik doğrulama işlemlerini yönetir.
GET /app/login
curl -X GET http://localhost:3000/app/login
GET /app/login-with-code
phone
(query): Ülke koduyla birlikte telefon numaranız (Örn: 905xxxxxxxxx
).curl -X GET "http://localhost:3000/app/login-with-code?phone=905xxxxxxxxx"
GET /app/logout
curl -X GET http://localhost:3000/app/logout
GET /app/reconnect
curl -X GET http://localhost:3000/app/reconnect
GET /app/devices
curl -X GET http://localhost:3000/app/devices
Kullanıcı bilgileri, profil ayarları ve kişi listesi gibi işlemleri yönetir.
GET /user/info
phone
(query): Bilgisi alınacak kullanıcının WhatsApp ID'si (Örn: 905xxxxxxxxx@s.whatsapp.net
).curl -X GET "http://localhost:3000/user/info?phone=905xxxxxxxxx@s.whatsapp.net"
GET /user/avatar
phone
(query): Avatarı alınacak kullanıcının WhatsApp ID'si.is_preview
(query, opsiyonel): true
ise fotoğrafın küçük bir önizlemesini getirir.is_community
(query, opsiyonel): true
ise topluluk avatarını getirir.curl -X GET "http://localhost:3000/user/avatar?phone=905xxxxxxxxx@s.whatsapp.net&is_preview=true"
POST /user/avatar
avatar
(form-data): Yüklenecek yeni profil fotoğrafı dosyası.curl -X POST http://localhost:3000/user/avatar \
-H "Content-Type: multipart/form-data" \
-F "avatar=@/path/to/your/image.jpg"
POST /user/pushname
push_name
(json): Ayarlamak istediğiniz yeni isim.curl -X POST http://localhost:3000/user/pushname \
-H "Content-Type: application/json" \
-d '{"push_name": "Yeni Isim"}'
GET /user/my/privacy
curl -X GET http://localhost:3000/user/my/privacy
GET /user/my/groups
curl -X GET http://localhost:3000/user/my/groups
GET /user/my/newsletters
curl -X GET http://localhost:3000/user/my/newsletters
GET /user/my/contacts
curl -X GET http://localhost:3000/user/my/contacts
GET /user/check
phone
(query): Kontrol edilecek telefon numarası.curl -X GET "http://localhost:3000/user/check?phone=905xxxxxxxxx"
Farklı türlerde (metin, resim, video, dosya vb.) mesaj gönderme işlemlerini gerçekleştirir.
POST /send/message
phone
(json): Mesajın gönderileceği alıcının WhatsApp ID'si.message
(json): Gönderilecek metin içeriği.reply_message_id
(json, opsiyonel): Yanıtlamak istediğiniz mesajın ID'si.is_forwarded
(json, opsiyonel): Mesajın iletilmiş olarak işaretlenip işaretlenmeyeceği.curl -X POST http://localhost:3000/send/message \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","message": "Merhaba, bu bir test mesajıdır."}'
POST /send/image
phone
(form-data): Alıcının WhatsApp ID'si.caption
(form-data, opsiyonel): Resim altı yazısı.view_once
(form-data, opsiyonel): true
ise resim tek seferlik görüntülenir.image
(form-data): Gönderilecek resim dosyası.image_url
(form-data): Gönderilecek resmin URL'si.compress
(form-data, opsiyonel): true
ise resim sıkıştırılır.curl -X POST http://localhost:3000/send/image \
-H "Content-Type: multipart/form-data" \
-F "phone=905xxxxxxxxx@s.whatsapp.net" \
-F "caption=Resim altı yazısı" \
-F "image=@/path/to/your/image.jpg"
POST /send/audio
phone
(form-data): Alıcının WhatsApp ID'si.audio
(form-data): Gönderilecek ses dosyası.audio_url
(form-data): Gönderilecek ses dosyasının URL'si.curl -X POST http://localhost:3000/send/audio \
-H "Content-Type: multipart/form-data" \
-F "phone=905xxxxxxxxx@s.whatsapp.net" \
-F "audio=@/path/to/your/audio.ogg"
POST /send/file
phone
(form-data): Alıcının WhatsApp ID'si.caption
(form-data, opsiyonel): Dosya altı yazısı.file
(form-data): Gönderilecek dosya.curl -X POST http://localhost:3000/send/file \
-H "Content-Type: multipart/form-data" \
-F "phone=905xxxxxxxxx@s.whatsapp.net" \
-F "caption=Dosya açıklaması" \
-F "file=@/path/to/your/document.pdf"
POST /send/video
phone
(form-data): Alıcının WhatsApp ID'si.caption
(form-data, opsiyonel): Video altı yazısı.view_once
(form-data, opsiyonel): true
ise video tek seferlik görüntülenir.video
(form-data): Gönderilecek video dosyası.video_url
(form-data): Gönderilecek videonun URL'si.curl -X POST http://localhost:3000/send/video \
-H "Content-Type: multipart/form-data" \
-F "phone=905xxxxxxxxx@s.whatsapp.net" \
-F "caption=Video açıklaması" \
-F "video=@/path/to/your/video.mp4"
POST /send/contact
phone
(json): Alıcının WhatsApp ID'si.contact_name
(json): Gönderilecek kişinin adı.contact_phone
(json): Gönderilecek kişinin telefon numarası.curl -X POST http://localhost:3000/send/contact \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","contact_name": "Ahmet Yılmaz","contact_phone": "905xxxxxxxxx"}'
POST /send/link
phone
(json): Alıcının WhatsApp ID'si.link
(json): Gönderilecek URL.caption
(json, opsiyonel): Bağlantı açıklaması.curl -X POST http://localhost:3000/send/link \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","link": "https://www.google.com","caption": "Google\'a bir göz atın!"}'
POST /send/location
phone
(json): Alıcının WhatsApp ID'si.latitude
(json): Enlem koordinatı.longitude
(json): Boylam koordinatı.curl -X POST http://localhost:3000/send/location \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","latitude": "41.0082","longitude": "28.9784"}'
POST /send/poll
phone
(json): Alıcının WhatsApp ID'si.question
(json): Anket sorusu.options
(json): Anket seçeneklerini içeren bir dizi (array).max_answer
(json): Verilebilecek maksimum cevap sayısı.curl -X POST http://localhost:3000/send/poll \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","question": "En sevdiğiniz renk hangisi?","options": ["Mavi", "Yeşil", "Kırmızı"],"max_answer": 1}'
POST /send/presence
type
(json): Durum tipi (available
veya unavailable
).curl -X POST http://localhost:3000/send/presence \
-H "Content-Type: application/json" \
-d '{"type": "available"}'
Gönderilmiş mesajlar üzerinde işlem yapmayı sağlar (silme, düzenleme, tepki verme vb.).
POST /message/{message_id}/revoke
message_id
(path): Silinecek mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.curl -X POST http://localhost:3000/message/MESSAGE_ID/revoke \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net"}'
POST /message/{message_id}/delete
message_id
(path): Silinecek mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.curl -X POST http://localhost:3000/message/MESSAGE_ID/delete \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net"}'
POST /message/{message_id}/reaction
message_id
(path): Tepki verilecek mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.emoji
(json): Gönderilecek emoji.curl -X POST http://localhost:3000/message/MESSAGE_id/reaction \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","emoji": "👍"}'
POST /message/{message_id}/update
message_id
(path): Düzenlenecek mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.message
(json): Mesajın yeni metni.curl -X POST http://localhost:3000/message/MESSAGE_ID/update \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net","message": "Düzenlenmiş mesaj içeriği."}'
POST /message/{message_id}/read
message_id
(path): Okundu olarak işaretlenecek mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.curl -X POST http://localhost:3000/message/MESSAGE_ID/read \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net"}'
POST /message/{message_id}/star
message_id
(path): Yıldızlanacak mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.curl -X POST http://localhost:3000/message/MESSAGE_ID/star \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net"}'
POST /message/{message_id}/unstar
message_id
(path): Yıldızı kaldırılacak mesajın ID'si.phone
(json): Mesajın gönderildiği sohbetin ID'si.curl -X POST http://localhost:3000/message/MESSAGE_ID/unstar \
-H "Content-Type: application/json" \
-d '{"phone": "905xxxxxxxxx@s.whatsapp.net"}'
WhatsApp gruplarını yönetmek için kullanılır (grup oluşturma, üye ekleme/çıkarma vb.).
POST /group
title
(json): Grubun başlığı.participants
(json): Gruba eklenecek üyelerin telefon numaralarını içeren dizi.curl -X POST http://localhost:3000/group \
-H "Content-Type: application/json" \
-d '{"title": "Yeni Grup","participants": ["905xxxxxxxxx", "905yyyyyyyyy"]}'
POST /group/participants
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Eklenecek üyelerin telefon numaraları.curl -X POST http://localhost:3000/group/participants \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905zzzzzzzzz"]}'
POST /group/participants/remove
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Çıkarılacak üyelerin telefon numaraları.curl -X POST http://localhost:3000/group/participants/remove \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905zzzzzzzzz"]}'
POST /group/participants/promote
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Yönetici yapılacak üyelerin telefon numaraları.curl -X POST http://localhost:3000/group/participants/promote \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905yyyyyyyyy"]}'
POST /group/participants/demote
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Yetkisi alınacak yöneticilerin telefon numaraları.curl -X POST http://localhost:3000/group/participants/demote \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905yyyyyyyyy"]}'
POST /group/join-with-link
link
(json): Katılınacak grubun davet bağlantısı.curl -X POST http://localhost:3000/group/join-with-link \
-H "Content-Type: application/json" \
-d '{"link": "https://chat.whatsapp.com/INVITE_LINK"}'
GET /group/participant-requests
group_id
(query): İstekleri listelenecek grubun ID'si.curl -X GET "http://localhost:3000/group/participant-requests?group_id=GROUP_ID@g.us"
POST /group/participant-requests/approve
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Katılma isteği onaylanacak kişilerin ID'leri.curl -X POST http://localhost:3000/group/participant-requests/approve \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905zzzzzzzzz"]}'
POST /group/participant-requests/reject
group_id
(json): İşlem yapılacak grubun ID'si.participants
(json): Katılma isteği reddedilecek kişilerin ID'leri.curl -X POST http://localhost:3000/group/participant-requests/reject \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us","participants": ["905zzzzzzzzz"]}'
POST /group/leave
group_id
(json): Ayrılınacak grubun ID'si.curl -X POST http://localhost:3000/group/leave \
-H "Content-Type: application/json" \
-d '{"group_id": "GROUP_ID@g.us"}'
Haber bültenlerini yönetmek için kullanılır.
POST /newsletter/unfollow
newsletter_id
(json): Takipten çıkılacak haber bülteninin ID'si.curl -X POST http://localhost:3000/newsletter/unfollow \
-H "Content-Type: application/json" \
-d '{"newsletter_id": "NEWSLETTER_ID@newsletter"}'