mirror of
https://git.meshkee.com/Meshkee/backend.git
synced 2026-08-11 22:30:59 +04:30
Add partner SMS gateway via Gama SendQuick and document it.
Expose POST /public/sms/send with API key + domain allowlist for external backends like Balout, wire Meshkee OTP/message sends to Gama, and publish Partner SMS docs on /docs/website. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
267a218c26
commit
f4295e780c
@@ -36,7 +36,8 @@
|
||||
{ "name": "Cities" },
|
||||
{ "name": "Cart" },
|
||||
{ "name": "Orders" },
|
||||
{ "name": "Favorites" }
|
||||
{ "name": "Favorites" },
|
||||
{ "name": "Partner SMS" }
|
||||
],
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
@@ -44,6 +45,12 @@
|
||||
"type": "http",
|
||||
"scheme": "bearer",
|
||||
"bearerFormat": "JWT"
|
||||
},
|
||||
"apiKeyAuth": {
|
||||
"type": "apiKey",
|
||||
"in": "header",
|
||||
"name": "X-Api-Key",
|
||||
"description": "Partner SMS API key (server-to-server only). Issued per allowlisted domain."
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
@@ -897,6 +904,62 @@
|
||||
],
|
||||
"responses": { "200": { "description": "{ message }" } }
|
||||
}
|
||||
},
|
||||
"/public/sms/send": {
|
||||
"post": {
|
||||
"tags": ["Partner SMS"],
|
||||
"summary": "Send SMS via Meshkee (partner gateway)",
|
||||
"description": "Server-to-server only. For external/partner backends (e.g. Balout) that need to send SMS through Meshkee → Gama. Not for browser/storefront JS. Requires an allowlisted `domain` + matching `X-Api-Key`. See /docs/website/SMS.md.",
|
||||
"security": [{ "apiKeyAuth": [] }],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["domain", "to", "message"],
|
||||
"properties": {
|
||||
"domain": {
|
||||
"type": "string",
|
||||
"example": "baloutpastry.com",
|
||||
"description": "Allowlisted partner apex (www. is stripped)"
|
||||
},
|
||||
"to": {
|
||||
"type": "string",
|
||||
"example": "09127004945",
|
||||
"description": "Iranian mobile: 09…, 9…, +989…, or 989…"
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"maxLength": 700,
|
||||
"example": "سفارش شما به شماره ی ۱۲۱۱۳۲۲ اماده می باشد."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Accepted by Gama",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": { "type": "boolean", "example": true },
|
||||
"serverId": { "type": "string", "example": "1136923081051406337" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": { "description": "Invalid phone or message" },
|
||||
"401": { "description": "Missing/invalid X-Api-Key or domain" },
|
||||
"429": { "description": "Rate limited (30/partner/min or 5/destination/min)" },
|
||||
"503": { "description": "SMS disabled or provider unreachable" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user