Skip to content

Incoming location message#

סעיף זה מתאר פורמט webhook נכנס של אובייקט 'messageData' עבור הודעת מיקום נכנסת. לתיאור של הפורמט הכללי של webhooks נכנסות, עיין בסעיף הודעות נכנסות.

כדי לקבל webhooks נכנס מסוג זה, שני תנאים חייבים להתקיים:

typeWebhook = IncomingMessageReceived

messageData.typeMessage = locationMessage

Webhook#

פרמטרים של Webhook#

פרמטרים של אובייקט messageData

פרמטר הקלד תֵאוּר
typeMessage **string* סוג הודעה שהתקבלה. עבור הודעות מסוג זה, הפרמטר מקבל את הערך locationMessage
locationMessageData object אובייקט נתוני מיקום שהתקבל
quotedMessage object אובייקט נתוני הודעה מצוטט. הצג רק אם ההודעה עצמה היא ציטוט

פרמטרי אובייקט locationMessageData

פרמטר הקלד תֵאוּר
nameLocation **string* שם המיקום
כתובת **string* כתובת המיקום
jpeg Thumbnail **string* תצוגה מקדימה של התמונה בקידוד base64
קו רוחב כפול קו רוחב מיקום
קו אורך כפול קו אורך מיקום
forwardingScore integer מספר העברות הודעות
isForwarded בוליאנית בין אם ההודעה מועברת, מקבלת ערכים אמת/לא נכון

פרמטרי אובייקט quotedMessage

פרמטר הקלד תיאור
stanzaId **string* מזהה הודעה מצוטט
משתתף **string* מזהה שולח ההודעה המצוטט
typeMessage **string* סוג הודעה מצוטט

שאר השדות ממולאים בהתאם לסוג ההודעה המצוטטת והם זהים לשדות ההודעות הנכנסות המתוארות בסעיף הודעות נכנסות

דוגמה לגוף Webhook#

{
  "typeWebhook": "incomingMessageReceived",
  "instanceData": {
    "idInstance": 1234,
    "wid": "11001234567@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79001234567@c.us",
    "chatName": "John",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "locationMessage",
    "locationMessageData": {
      "nameLocation": "Empire State Building",  
      "address": "20 W 34th St., New York, NY 10001, US",
      "jpegThumbnail": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFx=",
      "latitude": 12.345678910111213,
      "longitude": 14.151617181920212,
      "forwardingScore": 0,
      "isForwarded": false
    }
  }
}

Location and text quote incoming message webhook body example#

{
  "typeWebhook": "incomingMessageReceived",
  "instanceData": {
    "idInstance": 1234,
    "wid": "11001234567@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
  "senderData": {
    "chatId": "79001234567@c.us",
    "sender": "79001234567@c.us",
    "chatName": "John",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "locationMessage",
    "locationMessageData": {
      "nameLocation": "Empire State Building",
      "address": "20 W 34th St., New York, NY 10001, US",
      "jpegThumbnail": "217",
      "latitude": 74.5922641,
      "longitude": 59.6645355,
      "forwardingScore": 4,
      "isForwarded": true
    },
    "quotedMessage": {
      "stanzaId": "9A73322488DCB7D9689A6112F2528C9D",
      "participant": "79001230022@c.us",
      "typeMessage": "textMessage",
      "textMessage": "Hello"
    }
  }
}