דוקומנטציה - Documentation
מבוא
ה-API שלנו מאפשר לכם לשלוח הודעות SMS, לנהל קמפיינים ולטפל באנשי קשר. כל הבקשות צריכות לכלול את ה-Access Token שלכם בכותרת Authorization.
Base URL:
https://api.vibrate.co.il/v1
Authentication:
Authorization: YOUR_ACCESS_TOKEN
📚 תוכן עניינים
נתוני משתמש
דוגמא לשליפת נתוני משתמש
fetch('https://api.vibrate.co.il/v1/user/info', {
method: 'GET',
headers: {
'Authorization': 'YOUR_ACCESS_TOKEN',
},
})
.then(res => res.json())
.then(data => console.log(data));
שליחת הודעות
דוגמא לשליחת הודעות לנמען יחיד
fetch('https://api.vibrate.co.il/v1/sms/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_ACCESS_TOKEN',
},
body: JSON.stringify({
recipients: ['0501231234'],
message: 'שלום עולם',
sender: 'MySender',
}),
})
.then(res => res.json())
.then(data => console.log(data));
דוגמא לשליחת הודעות למספר נמענים
fetch('https://api.vibrate.co.il/v1/sms/sendBulk', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_ACCESS_TOKEN',
},
body: JSON.stringify({
sender: 'MySender',
messages: [
{
recipient: '0501231234',
message: 'הודעה ראשונה'
},
{
recipient: '0505675678',
message: 'הודעה שנייה'
}
]
}),
})
.then(res => res.json())
.then(data => console.log(data));
רשימות תפוצה
דוגמא לשליפת כל רשימות התפוצה
fetch('https://api.vibrate.co.il/v1/sms/campaigns', {
method: 'GET',
headers: {
'Authorization': 'YOUR_ACCESS_TOKEN',
},
})
.then(res => res.json())
.then(data => console.log(data));
דוגמא ליצירת רשימת תפוצה חדשה
fetch('https://api.vibrate.co.il/v1/sms/campaigns', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_ACCESS_TOKEN',
},
body: JSON.stringify({
name: "רשימת תפוצה חדשה"
}),
})
.then(res => res.json())
.then(data => console.log(data));
אנשי קשר
דוגמא לשליפת אנשי קשר לפי מזהה רשימת תפוצה
fetch('https://api.vibrate.co.il/v1/sms/campaigns/{{campaignId}}/contacts', { // Replace with your campaign ID
method: 'GET',
headers: {
'Authorization': 'YOUR_ACCESS_TOKEN',
},
})
.then(res => res.json())
.then(data => console.log(data));
דוגמה להוספת איש קשר למקפיין
fetch('https://api.vibrate.co.il/v1/sms/campaigns/{{campaignId}}/contacts', { // Replace with your campaign ID
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'YOUR_ACCESS_TOKEN',
},
body: JSON.stringify({
name: "David Beckham",
phoneNumber: "0505975550",
additionalFields: {
"first name": "David",
"last name": "Beckham"
}
}),
})
.then(res => res.json())
.then(data => console.log(data));