יצירת איש קשר במקס + עדכון משתנים +שליחת הודעה + קובץ בAPI ​

להלן העתק הקוד כפי שמוצג בסרטון:

כמובן יש לשנות את הטוקן בהתאם לטוקן שלכם במערכת מקס

curl –location ‘https://chat.maxchats.com/api/integrations/send-message’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
XXXXXUSE YOUR OWN BEARIERXXXV’ \
–data ‘{
“phone”: “972525787657”,
“text”: “- ניתן לכתוב כל הודעה – לצרף קובץ או תמונה וכמובן לינק לדוגמה: https://maxchats.com *ליצור ולעדכן איש קשר * במקס בוט עם משתנים.* ההודעה נכתבה ונשלחה מפוסטמן*,”,
“attachment”: {
“type”: “1”,
“mime”: “1”,
“url”: “https://maxchats.com/wp-content/uploads/2023/06/%D7%A2%D7%99%D7%A6%D7%95%D7%91-%D7%9C%D7%9C%D7%90-%D7%A9%D7%9D-6.png”
},
“variables”: {
“city”: “תל אביב”
}
}’

שליחת טריגר ב API

ניתן גם לשלוח טריגר ממערכות חיצוניות ולהתחיל תהליך במקס בוט – (הודעה/שאלון התאמה/רישום לקמפיין/שיוך למחלקה/תיוג/חסימה או הורדה מקמפיין וכו’)

זהו הקוד להפעלת טריגר:

curl –location ‘https://chat.maxchats.com/api/integrations/send-message’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer XXXUSE YOUR OWNXXXXX \
–data ‘{
“phone”: “972525787657”,
“text”: “- ניתן לכתוב כל הודעה – לצרף קובץ או תמונה וכמובן לינק לדוגמה: https://maxchats.com *ליצור ולעדכן איש קשר * במקס בוט עם משתנים.* ההודעה נכתבה ונשלחה מפוסטמן*,”,
“attachment”: {
“type”: “1”,
“mime”: “1”,
“url”: “https://maxchats.com/wp-content/uploads/2023/06/%D7%A2%D7%99%D7%A6%D7%95%D7%91-%D7%9C%D7%9C%D7%90-%D7%A9%D7%9D-6.png”
},
“variables”: {
“city”: “תל אביב”
}
}’

 explanation of each part:

--location: Follow redirects when making requests.

--header 'Accept: application/json': Set the “Accept” header to indicate that the client expects JSON.

--header 'Content-Type: application/json': Set the “Content-Type” header to indicate that the data being sent is in JSON format.

--header 'Authorization: Bearer QMB75fo05gFVGz14rRHgLtuxPqZNGPCsHXCb1dDnAZJblFoCzJIOMUfuI3LwhaLV': Include the Authorization header with the provided Bearer token.

--data '{...}': Send a POST request with the JSON data enclosed in single quotes.

The JSON data contains the parameters for the MaxChats API:

phone: The phone number to send the message to.

text: The message text in Hebrew.

attachment: An object with information about the attachment (image in this case).

  • type: Attachment type.
  • mime: MIME type of the attachment.
  • url: URL of the attachment (an image in this case).

variables: Additional variables, in this case, the city is set to “תל אביב”.

Make sure to replace the placeholder token, phone number, and any other details with the actual values you want to use.

יצירת איש קשר במקס + עדכון משתנים +שליחת הודעה + API

רשום לקמפיין סדרת מסרים באמצעות API ע”י שליחת טריגר למערכת מקס בוט

api call – trigger

curl –location ‘https://chat.maxchats.com/api/integrations/trigger-event’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer LzqB8pXXXXXXYOUR BEREAR XXXXXXXb90ehEUd’ \
–data ‘{
“phone”: “VAR_FROM CRM”,
“trigger”: “assign_campaign
}’

 

חסימת לקוח שביקש הסרה ע”י  TRIGGER API ממערכות צד ג’ אל מערכת מקס בוט

api call – trigger

curl –location ‘https://chat.maxchats.com/api/integrations/trigger-event’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer LzqB8pXXXXXXYOUR BEREAR XXXXXXX’ \
–data ‘{
“phone”: “VAR_FROM CRM”,
“trigger”: “block_contact
}’

 

שליחת API להקמה ועדכון איש קשר במקס בוט 

FIRST API CALL – UPDATE CONTACT

curl –location ‘https://chat.maxchats.com/api/clients/update‘ \
–header ‘Authorization: Bearer XXXXXUSE YOUR OWN BEARIERXXXXX’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
–data ‘{
“phone”:”9725525787657″,
“note”: “נוצר ב API”,
“variables”: {
“send-message”: “Test sms from Postman”,
“first_name”:”Bozo”,
“business_name”:”Signals”,
“country”:”ישראל”
},
“department_id”: 459,
“add_tags”:[“סבבה”, “מעוניין””]
}’

SECONDAPI CALL – trigger

curl –location ‘https://chat.maxchats.com/api/integrations/trigger-event’ \
–header ‘Accept: application/json’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Bearer XXXXXUSE YOUR OWN BEARIERXXXXX’ \
–data ‘{
“phone”: “VAR_FROM CRM”,
“trigger”: “remove_campaign”
}’