bat/messagelist މެދުވެރިކޮށް WhatsApp
WhatsApp Business މެސެޖު ފޮނުވަނީ SMS އާއި Viber އާ އެއްގޮތަށް އެއް ރިކުއެސްޓުންނެވެ: "type": "whatsapp" އާއެކު POST /bat/messagelist. މެސެޖުގެ ކޮންޓެންޓް އެ ދަނީ whatsAppMessage އޮބްޖެކްޓަށެވެ.
މި ޕޭޖުގައިވާ ކޮންމެ މިސާލެއްގެ ތައްޔާރު ރިކުއެސްޓްތައް Postman ކަލެކްޝަނުގައި ހުއްޓެވެ، ތިރީގައިވާ “Postman ކަލެކްޝަން” ބައި ބައްލަވާ.
މެސެޖުގެ ދެ ބާވަތް
| ބާވަތް | whatsAppMessage.type | ފޮނުވެވޭނެ ވަގުތު |
|---|---|---|
| ސެޝަން މެސެޖުތައް: ޓެކްސްޓް، މީޑިއާ، ލޮކޭޝަން، ކޮންޓެކްޓް، އިންޓަރެކްޓިވް | text، media، location، contact، interactive | ކަސްޓަމަރުގެ އެންމެ ފަހުގެ އެތެރެއަށް ލިބުނު މެސެޖަށްފަހު 24 ގަޑިއިރުގެ ސެޝަން ވިންޑޯގެ ތެރޭގައި ހަމައެކަނި. |
| ޓެމްޕްލޭޓް | template | ކޮންމެ ވަގުތަކު. ޓެމްޕްލޭޓަށް ތިބާގެ WhatsApp Business އެކައުންޓް (WABA) ގައި ހުއްދަ ލިބިފައި ވާންޖެހެއެވެ. |
ސެޝަން ވިންޑޯއެއް ނެތިނަމަ، ހުއްދަ ލިބިފައިވާ ޓެމްޕްލޭޓެއް ފޮނުއްވާ. މި ގަވާއިދު ހިނގަނީ WhatsApp އަކީ ފޯލްބެކް ޗެއިނެއްގެ ފިޔަވަޅެއްނަމަވެސްއެވެ.
އާންމު ފީލްޑުތައް
{
"callbackUrl": "https://example.com/smsbat/status",
"messages": [
{
"from": "WABA_PHONE",
"to": "RECIPIENT_PHONE",
"type": "whatsapp",
"ttl": 60,
"whatsAppMessage": { "type": "text", "text": "Your order is ready." }
}
]
}
| ފީލްޑު | ތަފްސީލް |
|---|---|
callbackUrl | ޑެލިވަރީ ކޯލްބެކްތަކުގެ އެޑްރެސް. އިޚްތިޔާރީ. |
from | މެސެޖު ފޮނުވާ WhatsApp Business ނަންބަރު. |
to | ލިބޭ ފަރާތުގެ ނަންބަރު. |
type | whatsapp. |
ttl | މެސެޖުގެ އުމުރު ސިކުންތުން. މިސާލުތަކުގައި 60 ބޭނުންކުރެއެވެ؛ ތިބާގެ ސިނާރިއޯއަށް ޚާއްސަކޮށް ސެޓްކުރައްވާ. |
whatsAppMessage | މެސެޖުގެ ކޮންޓެންޓް، ތިރީގައިވާ ބައިތައް ބައްލަވާ. |
އޮތެންޓިކޭޝަން: SMSBAT API ގެ ހުރިހާ ރިކުއެސްޓެއްގެ ގޮތަށް، އޮރގާނިޒޭޝަންގެ ކީއާއެކު X-Authorization-Key ހެޑަރު.
ސެޝަން މެސެޖުތައް
މި ބައިގައިވާ ކޮންމެ މިސާލަކަށްވެސް 24 ގަޑިއިރުގެ ސެޝަން ވިންޑޯ ބޭނުންވެއެވެ.
ޓެކްސްޓް
"whatsAppMessage": {
"type": "text",
"text": "Your order is ready."
}
ކެޕްޝަންއާއެކު ފޮޓޯ
"whatsAppMessage": {
"type": "media",
"media": {
"type": "image",
"url": "https://example.com/image.png",
"caption": "Your order is ready."
}
}
media.url އަކީ ފޮޓޯގެ އާންމު HTTPS އެޑްރެހެވެ. caption އިޚްތިޔާރީ.
ކެޕްޝަންއާއެކު ވީޑިއޯ
"whatsAppMessage": {
"type": "media",
"media": {
"type": "video",
"url": "https://example.com/video.mp4",
"caption": "Your order is ready."
}
}
އޯޑިއޯ
"whatsAppMessage": {
"type": "media",
"media": {
"type": "audio",
"url": "https://example.com/audio.mp3"
}
}
ޑޮކިއުމެންޓް
"whatsAppMessage": {
"type": "media",
"media": {
"type": "document",
"url": "https://example.com/invoice.pdf",
"filename": "invoice.pdf",
"caption": "Your invoice"
}
}
filename އިން ލިބޭ ފަރާތަށް ފެންނާނެ ފައިލްގެ ނަން ސެޓްކުރެއެވެ. caption އިޚްތިޔާރީ.
media ފީލްޑުތައް:
| ފީލްޑު | ތަފްސީލް |
|---|---|
type | image، video، audio ނުވަތަ document. |
url | ފައިލްގެ އާންމު HTTPS އެޑްރެސް. |
caption | ކެޕްޝަން. އިޚްތިޔާރީ؛ މިސާލުތަކުގައި އެ ބޭނުންކުރަނީ ފޮޓޯ، ވީޑިއޯ އަދި ޑޮކިއުމެންޓަށެވެ. |
filename | ޑޮކިއުމެންޓްގެ ފައިލް ނަން. |
ލޮކޭޝަން
"whatsAppMessage": {
"type": "location",
"location": {
"latitude": 48.1486,
"longitude": 17.1077,
"name": "Pickup point",
"address": "Bratislava"
}
}
ބޭނުންވާނަމަ ތަނުގެ ނަމާއި އެޑްރެސް އިތުރުކުރައްވާ.
ކޮންޓެކްޓް
"whatsAppMessage": {
"type": "contact",
"contact": {
"name": {
"formatted_name": "Support Team",
"first_name": "Support"
},
"phones": [
{ "phone": "+421900000000", "type": "WORK" }
]
}
}
ފުރިހަމަ ދައްކާ ނަމާއި (formatted_name) އިތުރުން، ދަށްވެގެން އެހެން ނަމުގެ ފީލްޑެއް ފުރުއްވާ، މިސާލަކަށް first_name.
ޖަވާބު ދޭ ބަޓަންތައް
"whatsAppMessage": {
"type": "interactive",
"interactive": {
"type": "button",
"body": { "text": "Confirm your order" },
"action": {
"buttons": [
{ "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } },
{ "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } }
]
}
}
}
ލިބޭ ފަރާތް ފިތާލީ ކޮން ބަޓަނެއްކަން ދެނެގަތުމަށް reply.id ބޭނުންކުރައްވާ. reply.title އަކީ ބަޓަނުގެ ލޭބަލެވެ.
ލިސްޓް
"whatsAppMessage": {
"type": "interactive",
"interactive": {
"type": "list",
"body": { "text": "Choose a pickup point" },
"action": {
"button": "View options",
"sections": [
{
"title": "Pickup points",
"rows": [
{ "id": "center", "title": "City centre" },
{ "id": "station", "title": "Main station" }
]
}
]
}
}
}
action.button އަކީ ލިސްޓް ހުޅުވާ ބަޓަނުގެ ލޭބަލެވެ. sections[].rows[] އަކީ އޮޕްޝަންތަކެވެ، ކޮންމެ އެއްކަމަށްވެސް id އަދި title ހުއްޓެވެ.
ޓެމްޕްލޭޓްތައް
ޓެމްޕްލޭޓްތައް ފޮނުވެވޭނީ ސެޝަން ވިންޑޯއެއް ނެތިވެސް، ކޮންމެ ވަގުތަކުއެވެ. ޓެމްޕްލޭޓަށް ތިބާ ފޮނުވާ WABA ގައި ހުއްދަ ލިބިފައި ވާންޖެހެއެވެ.
ޓެމްޕްލޭޓެއް ފުރާނެ ގޮތް
| ފީލްޑު | ތަފްސީލް |
|---|---|
template.id | ހުއްދަ ލިބިފައިވާ ޓެމްޕްލޭޓްގެ ތެދު ނަން. |
template.language | އެ ޓެމްޕްލޭޓްގެ ބަހުގެ ކޯޑު، މިސާލަކަށް uk ނުވަތަ en_US. |
template.body.parameters | ޓެކްސްޓް ވެރިއޭބަލްތަކުގެ އަގުތައް، ޓެމްޕްލޭޓްގެ ތަރުތީބުން: [{ "text": "..." }]. ވެރިއޭބަލް ނެތިނަމަ body ދޫކޮށްލައްވާ. |
template.header | ބަދަލުވާ ހެޑަރ ހުރި ޓެމްޕްލޭޓަށް ހަމައެކަނި. ސްޓެޓިކް ހެޑަރަކަށް ބޭނުމެއް ނުވެއެވެ. |
template.buttons | ޑައިނަމިކް URL ބަޓަނަށާއި ކުއިކް ރިޕްލައި ބަޓަންތަކަށް ހަމައެކަނި. |
ސްޓެޓިކް ބަޓަނުގެ URL އާއި ކޯލް ބަޓަނުގެ ފޯނު ނަންބަރު ސެޓްކުރެވެނީ ޓެމްޕްލޭޓުގައެވެ، އަދި ފޮނުވާއިރު ނުފޮނުވެއެވެ. ޕެރަމީޓަރުތަކުގެ އަދަދާއި ބަޓަންތަކުގެ އަދަދު ތިބާގެ ހުއްދަ ލިބިފައިވާ ޓެމްޕްލޭޓާ އެއްގޮތް ވާންޖެހެއެވެ.
ޓެކްސްޓް ޓެމްޕްލޭޓް
"whatsAppMessage": {
"type": "template",
"template": {
"id": "YOUR_TEMPLATE_NAME",
"language": "uk",
"body": {
"parameters": [ { "text": "Alex" } ]
}
}
}
ޑައިނަމިކް URL ބަޓަން
"whatsAppMessage": {
"type": "template",
"template": {
"id": "YOUR_TEMPLATE_NAME",
"language": "uk",
"body": {
"parameters": [
{ "text": "Oleh" },
{ "text": "1 January 2024" },
{ "text": "+1 555-745-2867" }
]
},
"buttons": [
{ "type": "url", "index": 0, "url_parameter": "ORDER-123" }
]
}
}
index އަކީ ޓެމްޕްލޭޓުގައި ބަޓަނުގެ ޕޮޒިޝަނެވެ، 0 އިން ފެށިގެން. url_parameter ގައި އެޑްރެހުގެ ބަދަލުވާ ބައި ހަމައެކަނި ފޮނުއްވާ. މިސާލަކަށް، ބަޓަނުގެ URL https://example.com/orders/{{1}} ނަމަ ORDER-123 އަގުން https://example.com/orders/ORDER-123 ލިބެއެވެ. ބަޓަނުގެ URL ސްޓެޓިކްނަމަ buttons ނުފޮނުއްވާ.
ކުއިކް ރިޕްލައި ބަޓަންތައް
"buttons": [
{ "type": "quick_reply", "index": 0, "quick_reply_payload": "CONFIRM" },
{ "type": "quick_reply", "index": 1, "quick_reply_payload": "CANCEL" }
]
quick_reply_payload އިން ލިބޭ ފަރާތް ފިތާލީ ކޮން ބަޓަނެއްކަން ދެނެގަތުމަށް އެހީތެރިވެއެވެ. ބަޓަންތަކުގެ އިންޑެކްސްތައް ޓެމްޕްލޭޓާ އެއްގޮތް ވާންޖެހެއެވެ.
ހެޑަރު: ޓެކްސްޓް
"header": { "type": "text", "text": "Order 123" }
header.text ގައި ހެޑަރ ވެރިއޭބަލްގެ އަގު ފޮނުއްވާ.
ހެޑަރު: ފޮޓޯ، ވީޑިއޯ، ޑޮކިއުމެންޓް
"header": { "type": "image", "image": { "url": "https://example.com/image.png" } }
"header": { "type": "video", "video": { "url": "https://example.com/video.mp4" } }
"header": {
"type": "document",
"document": { "url": "https://example.com/file.pdf", "filename": "sample.pdf" }
}
URL އަކީ އާންމު HTTPS އެޑްރެހެއް ވާންޖެހެއެވެ. ޑޮކިއުމެންޓަށް filename އިން އެޓޭޗްމަންޓްގެ ނަން ސެޓްކުރެއެވެ.
ޑެލިވަރީ ހާލަތުތައް
WhatsApp މެސެޖުތަކުގެ ހާލަތުތައް callbackUrl އަށް ލިބެނީ ޑެލިވަރީ ކޯލްބެކް ފޯމެޓުގައެވެ: delivered، undeliverable ނުވަތަ permanenterror.
Postman ކަލެކްޝަން
“OmniSMSBat · BAT /messagelist” ކަލެކްޝަން ޑައުންލޯޑްކުރައްވާ: WhatsApp (ސެޝަން މެސެޖުތަކާއި 7 ބާވަތުގެ ޓެމްޕްލޭޓް)، Viber ބިޒްނަސް، SMS އަދި ފޯލްބެކްތަކުގެ ތައްޔާރު ރިކުއެސްޓްތައް.
- ފައިލް Postman އަށް އިމްޕޯޓްކުރައްވާ.
- ކަލެކްޝަންގެ ވެރިއޭބަލްތައް ފުރުއްވާ:
orgKey(އޮރގާނިޒޭޝަންގެ ކީ)،toPhone(ލިބޭ ފަރާތުގެ ނަންބަރު)،wabaPhone(WhatsApp ފޮނުވާ ނަންބަރު)،alphaName(Viber ބިޒްނަސް އަދި SMS އަށް އަލްފާ ނަން) އަދި، ބޭނުންވާނަމަ،callbackUrl. - ޓެމްޕްލޭޓް ރިކުއެސްޓްތަކުގައި
template.idގައިވާPLACEHOLDER_...ތިބާގެ ހުއްދަ ލިބިފައިވާ ޓެމްޕްލޭޓްގެ ނަމުން ބަދަލުކޮށްtemplate.languageޗެކްކުރައްވާ.
ރިކުއެސްޓްތައް ދަނީ ޕްރޮޑަކްޝަން ސާވަރު https://restapi.smsbat.com އަށް، އަދި ޗާޖްކުރެވިދާނެއެވެ. ވަކި ޓެސްޓް ތަނެއް ނެތެވެ.