דוקומנטציה - Documentation

נתוני משתמש
דוגמא לשליפת נתוני משתמש
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));