{
  "openapi": "3.0.0",
  "info": {
    "title": "SMSGO 簡訊購 SMS Gateway API",
    "description": "透過 HTTP POST 方式，使用 SMSGO 平台發送簡訊的 API。\n\n---\n\n**主要功能：**\n\n- **多種編碼：** 支援 `BIG5`（繁體中文）、`ASCII`、`UCS2`（Unicode）。\n- **長簡訊：** 最多 335 個中文字。\n- **WAP Push：** 直接傳送連結至手機。\n- **預約發送：** 排程未來時間發送。\n- **回調通知：** 設定 Webhook 接收發送狀態及用戶回覆。\n\n---\n\n**注意事項：**\n\n1. `BIG5`/`ASCII`/`UCS2` 目前都只支援單則簡訊，超過字數部份會自動截斷。\n2. `PBIG5`/`PASCII` 為 POPUP 簡訊，`LBIG5`/`LASCII`/`LUCS2` 為長簡訊，目前長簡訊只支援 335 個中文字。\n3. 如 Encoding 為 `PUSH`，則 `smbody` 與 `wapurl` 兩者相加最多 88 Bytes（中文字算 3 Bytes）。超過則自動轉長簡訊。\n4. 當 `replyurl` 有設置合法的 URL，即啟動回覆簡訊功能，每 10 則多扣一點（長度不超過 300）。\n5. 國際簡訊 `encoding` 只能用 `BIG5`/`ASCII`/`UCS2`；簡體中文請用 `UCS2`。\n> ⚠️ **重要：** 使用本 API 前，請先聯繫客服開通 API 功能。\n\n---\n\n**聯絡我們：**\n\n- 💬 LINE：[@cdn4573o](https://line.me/R/ti/p/@cdn4573o)",
    "version": "1.6.4",
    "contact": {
      "name": "簡訊購客服",
      "url": "https://www.smsgo.com.tw/online/online.asp?click=4"
    }
  },
  "servers": [
    {
      "url": "https://www.smsgo.com.tw",
      "description": "Production Server"
    }
  ],
  "tags": [
    {
      "name": "SMS",
      "description": "簡訊發送與管理相關操作。"
    },
    {
      "name": "Query",
      "description": "查詢簡訊發送狀態相關操作。"
    },
    {
      "name": "Account",
      "description": "帳號設定與點數管理相關操作。"
    },
    {
      "name": "Verification",
      "description": "發送與驗證一次性密碼（OTP）相關操作。"
    }
  ],
  "components": {
    "parameters": {
      "Username": {
        "name": "username",
        "in": "query",
        "required": true,
        "description": "會員帳號",
        "schema": {
          "type": "string",
          "example": "your_username"
        }
      },
      "Password": {
        "name": "password",
        "in": "query",
        "required": true,
        "description": "會員密碼 或 API Key",
        "schema": {
          "type": "string",
          "format": "password",
          "example": "your_password"
        }
      },
      "DstAddr": {
        "name": "dstaddr",
        "in": "query",
        "required": true,
        "description": "接收簡訊之手機號碼，多筆以逗號分隔（不可超過 50 筆）。國內號碼：`09xxxxxxxx`；國際號碼：開頭加 `+`（URL 編碼為 `%2b`），例如大陸：`%2b8613681912700`。",
        "schema": {
          "type": "string",
          "example": "0912345678"
        }
      },
      "DstAddrBulk": {
        "name": "dstaddr",
        "in": "query",
        "required": true,
        "description": "一或多個手機號碼，以逗號分隔。筆數須與 `msgid` 對應。",
        "schema": {
          "type": "string",
          "example": "0912345678,0987654321"
        }
      },
      "SmBody": {
        "name": "smbody",
        "in": "query",
        "required": true,
        "description": "簡訊內容。中英文混合最多 70 字元，純英文最多 160 字元。長簡訊（`L*`）最多 335 字元。WAP Push 時此欄為標題，`smbody`+`wapurl` 合計不超過 88 Bytes。",
        "schema": {
          "type": "string",
          "example": "Hello from SMSGO"
        }
      },
      "Encoding": {
        "name": "encoding",
        "in": "query",
        "required": false,
        "description": "訊息編碼格式。預設：`BIG5`。\n\n| 值 | 說明 |\n|---|---|\n| `BIG5` | 繁體中文，單則簡訊，最多 70 字 |\n| `ASCII` | 純英文，單則簡訊，最多 160 字 |\n| `UCS2` | Unicode（日文、韓文、簡體中文）|\n| `PBIG5` | POPUP 繁體中文 |\n| `PASCII` | POPUP 純英文 |\n| `LBIG5` | 長簡訊繁體中文，最多 335 字 |\n| `LASCII` | 長簡訊純英文 |\n| `LUCS2` | 長簡訊 Unicode |\n| `PUSH` | WAP Push（需搭配 `wapurl`）|",
        "schema": {
          "type": "string",
          "default": "BIG5",
          "enum": [
            "BIG5",
            "ASCII",
            "UCS2",
            "PBIG5",
            "PASCII",
            "LBIG5",
            "LASCII",
            "LUCS2",
            "PUSH"
          ]
        }
      },
      "DlvTime": {
        "name": "dlvtime",
        "in": "query",
        "required": false,
        "description": "預約發送時間。格式：`YYYY/MM/DD hh24:mm:ss`。留空即立即發送。",
        "schema": {
          "type": "string",
          "example": "2026/12/31 09:00:00"
        }
      },
      "WapUrl": {
        "name": "wapurl",
        "in": "query",
        "required": false,
        "description": "WAP Push 目標網址。僅在 `encoding=PUSH` 時使用，與 `smbody` 合計不超過 88 Bytes。",
        "schema": {
          "type": "string",
          "format": "uri",
          "example": "https://www.example.com"
        }
      },
      "ReplyUrl": {
        "name": "replyurl",
        "in": "query",
        "required": false,
        "description": "接收用戶回覆的 Callback URL（需另計點：每 10 則多扣一點）。僅適用 `BIG5`/`ASCII`/`UCS2`。長度不超過 300 字元。",
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "ReplyDays": {
        "name": "replydays",
        "in": "query",
        "required": false,
        "description": "收取用戶回覆的天數，預設 3 天，最多 30 天。僅適用 `BIG5`/`ASCII`/`UCS2`。",
        "schema": {
          "type": "integer",
          "default": 3,
          "minimum": 1,
          "maximum": 30
        }
      },
      "ResponseCallback": {
        "name": "response",
        "in": "query",
        "required": false,
        "description": "發送狀態回報的 Callback URL，系統會 POST 狀態更新至此網址。留空則不回報。",
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "Rtype": {
        "name": "rtype",
        "in": "query",
        "required": false,
        "description": "回傳格式。省略為純文字，`JSON` 回傳 JSON，`XML` 回傳 XML。",
        "schema": {
          "type": "string",
          "enum": [
            "JSON",
            "XML"
          ]
        }
      },
      "MsgId": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "發送成功後取得的訊息代號。",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "MsgIdBulk": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "一或多個訊息代號，以逗號分隔。筆數須與 `dstaddr` 對應。",
        "schema": {
          "type": "string",
          "example": "100101121234567,100101121234568"
        }
      },
      "MsgIdCancel": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "欲取消的預約簡訊訊息代號。",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "CodeLength": {
        "name": "codelength",
        "in": "query",
        "required": false,
        "description": "驗證碼長度：`4` 或 `6` 位數。預設：`4`。",
        "schema": {
          "type": "integer",
          "enum": [
            4,
            6
          ],
          "default": 4
        }
      },
      "OtpCode": {
        "name": "OtpCode",
        "in": "query",
        "required": true,
        "description": "用戶輸入的 OTP 驗證碼（4 或 6 位數字）。",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{4,6}$",
          "example": "123456"
        }
      },
      "SerialNumber": {
        "name": "serial_number",
        "in": "query",
        "required": true,
        "description": "發送 OTP（`/verify.aspx`）時回傳的 `msgid`。",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "Resend": {
        "name": "resend",
        "in": "query",
        "required": false,
        "description": "設為 `true` 可在 OTP 過期時自動重送新驗證碼（statuscode `-25`）。",
        "schema": {
          "type": "boolean"
        }
      }
    },
    "schemas": {
      "AuthFields": {
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string",
            "description": "會員帳號",
            "example": "your_username"
          },
          "password": {
            "type": "string",
            "format": "password",
            "description": "會員密碼 或 API Key",
            "example": "your_password"
          }
        }
      },
      "RtypeField": {
        "type": "object",
        "properties": {
          "rtype": {
            "type": "string",
            "enum": [
              "JSON",
              "XML"
            ],
            "description": "Response format: JSON / XML / (blank = plain text)"
          }
        }
      },
      "SendSmsPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "dstaddr",
              "smbody"
            ],
            "properties": {
              "dstaddr": {
                "type": "string",
                "description": "接收簡訊之手機號碼，多筆以逗號分隔（不可超過 50 筆）。國內號碼：`09xxxxxxxx`；國際號碼：開頭加 `+`（URL 編碼為 `%2b`），例如大陸：`%2b8613681912700`。",
                "example": "0912345678"
              },
              "smbody": {
                "type": "string",
                "description": "簡訊內容。中英文混合最多 70 字元，純英文最多 160 字元。長簡訊（`L*`）最多 335 字元。WAP Push 時此欄為標題，`smbody`+`wapurl` 合計不超過 88 Bytes。",
                "example": "Hello from SMSGO API"
              },
              "encoding": {
                "type": "string",
                "default": "BIG5",
                "enum": [
                  "BIG5",
                  "ASCII",
                  "UCS2",
                  "PBIG5",
                  "PASCII",
                  "LBIG5",
                  "LASCII",
                  "LUCS2",
                  "PUSH"
                ]
              },
              "dlvtime": {
                "type": "string",
                "description": "預約發送時間。格式：`YYYY/MM/DD hh24:mm:ss`。留空即立即發送。",
                "example": "2026/12/31 09:00:00"
              },
              "wapurl": {
                "type": "string",
                "format": "uri",
                "description": "WAP Push 目標網址。僅在 `encoding=PUSH` 時使用，與 `smbody` 合計不超過 88 Bytes。"
              },
              "replyurl": {
                "type": "string",
                "format": "uri",
                "description": "接收用戶回覆的 Callback URL（需另計點：每 10 則多扣一點）。僅適用 `BIG5`/`ASCII`/`UCS2`。長度不超過 300 字元。"
              },
              "replydays": {
                "type": "integer",
                "default": 3,
                "minimum": 1,
                "maximum": 30,
                "description": "收取用戶回覆的天數，預設 3 天，最多 30 天。僅適用 `BIG5`/`ASCII`/`UCS2`。"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "接收用戶回覆的 Callback URL（需另計點：每 10 則多扣一點）。僅適用 `BIG5`/`ASCII`/`UCS2`。長度不超過 300 字元。"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      },
      "QuerySmsPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "msgid",
              "dstaddr"
            ],
            "properties": {
              "msgid": {
                "type": "string",
                "description": "發送成功後取得的訊息代號",
                "example": "100101121234567"
              },
              "dstaddr": {
                "type": "string",
                "description": "接收簡訊之手機號碼",
                "example": "0912345678"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      },
      "QueryBulkPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "msgid",
              "dstaddr"
            ],
            "properties": {
              "msgid": {
                "type": "string",
                "description": "一或多個訊息代號，以逗號分隔。筆數須與 `dstaddr` 對應。",
                "example": "100101121234567,100101121234568"
              },
              "dstaddr": {
                "type": "string",
                "description": "一或多個手機號碼，以逗號分隔。筆數須與 `msgid` 對應。",
                "example": "0912345678,0987654321"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      },
      "QueryPointPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "$ref": "#/components/schemas/RtypeField"
          }
        ]
      },
      "CancelSmsPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "msgid"
            ],
            "properties": {
              "msgid": {
                "type": "string",
                "description": "發送成功後取得的訊息代號",
                "example": "100101121234567"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      },
      "SendVerifyPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "dstaddr"
            ],
            "properties": {
              "dstaddr": {
                "type": "string",
                "description": "接收簡訊之手機號碼",
                "example": "0912345678"
              },
              "codelength": {
                "type": "integer",
                "enum": [
                  4,
                  6
                ],
                "default": 4,
                "description": "OTP length: 4 or 6"
              },
              "dlvtime": {
                "type": "string",
                "description": "預約發送時間。格式：`YYYY/MM/DD hh24:mm:ss`。留空即立即發送。"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "發送狀態回報的 Callback URL，系統會 POST 狀態更新至此網址。留空則不回報。"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      },
      "AckVerifyPayload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AuthFields"
          },
          {
            "type": "object",
            "required": [
              "dstaddr",
              "OtpCode",
              "serial_number"
            ],
            "properties": {
              "dstaddr": {
                "type": "string",
                "description": "接收簡訊之手機號碼",
                "example": "0912345678"
              },
              "OtpCode": {
                "type": "string",
                "pattern": "^[0-9]{4,6}$",
                "description": "用戶輸入的 OTP 驗證碼（4 或 6 位數字）。",
                "example": "123456"
              },
              "serial_number": {
                "type": "string",
                "description": "msgid from Send OTP response",
                "example": "100101121234567"
              },
              "resend": {
                "type": "boolean",
                "description": "設為 `true` 可在 OTP 過期時自動重送新驗證碼（statuscode `-25`）。"
              },
              "dlvtime": {
                "type": "string",
                "description": "預約發送時間。格式：`YYYY/MM/DD hh24:mm:ss`。留空即立即發送。"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "發送狀態回報的 Callback URL，系統會 POST 狀態更新至此網址。留空則不回報。"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      }
    },
    "responses": {
      "SmsApiResponse": {
        "description": "API 回應。格式由 `rtype` 決定。`statuscode=0` 表示成功。\n\n**錯誤代碼說明：**\n\n| 代碼 | 說明 |\n|:---|:---|\n| `0` | 成功 |\n| `-1` | CGI 參數格式錯誤 |\n| `-2` | 帳號、密碼或 IP 驗證失敗 |\n| `-3` | 帳號或密碼為空 |\n| `-5` | 手機號碼格式錯誤 |\n| `-8` | 點數不足 |\n| `-9` | 超過手機號碼數量限制 |\n| `-10` | 發送失敗 |\n| `-11` | 資料庫錯誤 |\n| `-12` | 簡訊內容為空 |\n| `-13` | 參數與號碼筆數不符 |\n| `-15` | IP 位址不允許 |\n| `-16` | API 服務未開通 |\n| `-17` | Callback URL 不允許 |\n| `-21` | 已達發送上限 |",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": "msgid=100101121234567\nstatuscode=0\nstatusstr=OK\npoint=1"
              },
              "Error": {
                "summary": "Error",
                "value": "msgid=-3\nstatuscode=-3\nstatusstr=username or password empty!\npoint=0"
              },
              "OtpVerifyFail": {
                "summary": "OTP wrong code (-24)",
                "value": "msgid=-24\nstatuscode=-24\nstatusstr=Verify Fail\npoint=0"
              },
              "OtpExpired": {
                "summary": "OTP expired (-25)",
                "value": "msgid=-25\nstatuscode=-25\nstatusstr=Verify Expired\npoint=0"
              }
            }
          },
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "result": {
                  "type": "object",
                  "properties": {
                    "msgid": {
                      "type": "string"
                    },
                    "statuscode": {
                      "type": "string"
                    },
                    "statusstr": {
                      "type": "string"
                    },
                    "point": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": {
                  "result": {
                    "msgid": "1504280910499665",
                    "statuscode": "0",
                    "statusstr": "OK",
                    "point": 1
                  }
                }
              },
              "Error": {
                "summary": "Error",
                "value": {
                  "result": {
                    "msgid": "-3",
                    "statuscode": "-3",
                    "statusstr": "username or password empty!",
                    "point": 0
                  }
                }
              },
              "OtpVerifyFail": {
                "summary": "OTP wrong code (-24)",
                "value": {
                  "result": {
                    "msgid": "-24",
                    "statuscode": "-24",
                    "statusstr": "Verify Fail",
                    "point": 0
                  }
                }
              },
              "OtpExpired": {
                "summary": "OTP expired (-25)",
                "value": {
                  "result": {
                    "msgid": "-25",
                    "statuscode": "-25",
                    "statusstr": "Verify Expired",
                    "point": 0
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "type": "object",
              "xml": {
                "name": "response"
              },
              "properties": {
                "code": {
                  "type": "string"
                },
                "msgid": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": "<response><code>0</code><msgid>1688888</msgid><text>Success</text></response>"
              },
              "Error": {
                "summary": "Error",
                "value": "<response><code>-1</code><msgid></msgid><text>Username or Password Empty</text></response>"
              },
              "OtpVerifyFail": {
                "summary": "OTP wrong code (-24)",
                "value": "<response><code>-24</code><msgid>-24</msgid><text>Verify Fail</text></response>"
              },
              "OtpExpired": {
                "summary": "OTP expired (-25)",
                "value": "<response><code>-25</code><msgid>-25</msgid><text>Verify Expired</text></response>"
              }
            }
          }
        }
      },
      "SendSmsApiResponse": {
        "description": "簡訊發送 API 回應。格式由 `rtype` 決定。`statuscode=0` 表示成功。\n\n**錯誤代碼說明：**\n\n| 代碼 | 說明 |\n|:---|:---|\n| `0` | 成功 |\n| `-1` | CGI 參數格式錯誤 |\n| `-2` | 帳號、密碼或 IP 驗證失敗 |\n| `-3` | 帳號或密碼為空 |\n| `-5` | 手機號碼格式錯誤 |\n| `-8` | 點數不足 |\n| `-9` | 超過手機號碼數量限制（最多 50 筆）|\n| `-10` | 發送失敗 |\n| `-11` | 資料庫錯誤 |\n| `-12` | 簡訊內容為空 |\n| `-13` | 參數與號碼筆數不符 |\n| `-14` | 包含詐騙關鍵字 |\n| `-15` | IP 位址不允許 |\n| `-16` | API 服務未開通 |\n| `-17` | Callback URL 不允許 |\n| `-18` | 門號不在服務範圍 |\n| `-19` | 號碼已被封鎖 |\n| `-20` | 判定為垃圾簡訊 |\n| `-21` | 已達發送上限 |\n| `-22` | 請求需重新路由 |\n| `-23` | 缺少簡訊署名 |\n| `-24` | OTP 驗證失敗 |\n| `-25` | OTP 已過期 |\n| `-30` | 電信業者系統 ID 錯誤 |",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": "msgid=100101121234567\nstatuscode=0\nstatusstr=OK\npoint=1"
              },
              "Error": {
                "summary": "Error",
                "value": "msgid=-3\nstatuscode=-3\nstatusstr=username or password empty!\npoint=0"
              }
            }
          },
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "result": {
                  "type": "object",
                  "properties": {
                    "msgid": {
                      "type": "string"
                    },
                    "statuscode": {
                      "type": "string"
                    },
                    "statusstr": {
                      "type": "string"
                    },
                    "point": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": {
                  "result": {
                    "msgid": "1504280910499665",
                    "statuscode": "0",
                    "statusstr": "OK",
                    "point": 1
                  }
                }
              },
              "Error": {
                "summary": "Error",
                "value": {
                  "result": {
                    "msgid": "-3",
                    "statuscode": "-3",
                    "statusstr": "username or password empty!",
                    "point": 0
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "type": "object",
              "xml": {
                "name": "response"
              },
              "properties": {
                "code": {
                  "type": "string"
                },
                "msgid": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Success": {
                "summary": "Success",
                "value": "<response><code>0</code><msgid>1688888</msgid><text>Success</text></response>"
              },
              "Error": {
                "summary": "Error",
                "value": "<response><code>-1</code><msgid></msgid><text>Username or Password Empty</text></response>"
              }
            }
          }
        }
      }
    }
  },
  "security": [],
  "paths": {
    "/sms_gw/sendsms.aspx": {
      "get": {
        "tags": [
          "SMS"
        ],
        "operationId": "sendSmsGet",
        "deprecated": true,
        "summary": "Send SMS (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead. Credentials appear in server logs.\n\nSend SMS via GET query parameters. All values must be URL-encoded.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/DstAddr"
          },
          {
            "$ref": "#/components/parameters/SmBody"
          },
          {
            "$ref": "#/components/parameters/Encoding"
          },
          {
            "$ref": "#/components/parameters/DlvTime"
          },
          {
            "$ref": "#/components/parameters/WapUrl"
          },
          {
            "$ref": "#/components/parameters/ReplyUrl"
          },
          {
            "$ref": "#/components/parameters/ReplyDays"
          },
          {
            "$ref": "#/components/parameters/ResponseCallback"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SendSmsApiResponse"
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    /* Handle error */\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(\"Response from server:\")\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/sendsms.aspx?username=your_username&password=your_password&dstaddr=0912345678&smbody=Test\"))\n                .GET()\n                .build();\n\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "SMS"
        ],
        "operationId": "sendSmsPost",
        "summary": "發送簡訊",
        "description": "發送簡訊。Content-Type 須為 `application/x-www-form-urlencoded`。",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SendSmsPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SendSmsApiResponse"
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&dstaddr=0912345678&smbody=Test' https://www.smsgo.com.tw/sms_gw/sendsms.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"dstaddr\", \"0912345678\");\nurlencoded.append(\"smbody\", \"Test\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/sendsms.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"dstaddr\", \"0912345678\" },\n            { \"smbody\", \"This is a test message from C#.\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/sendsms.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/sendsms.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'dstaddr' => '0912345678',\n    'smbody' => 'This is a test message from PHP.'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    /* Handle error */\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/sendsms.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'dstaddr': '0912345678',\n    'smbody': 'This is a test message from Python.'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()  # Raise an exception for bad status codes\n    print(\"Response from server:\")\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/sendsms.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&dstaddr=0912345678&smbody=Test\"))\n                .build();\n\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/query.aspx": {
      "get": {
        "tags": [
          "Query"
        ],
        "operationId": "querySmsStatusGet",
        "deprecated": true,
        "summary": "Query SMS Status (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead.\n\nQuery delivery status of a single SMS.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/MsgId"
          },
          {
            "$ref": "#/components/parameters/DstAddr"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery status. Plain text format: `statusCode|statusStr|cellphone`\n\n**statusStr values:** `DELIVRD`, `REJECTD`, `EXPIRED`, `UNDELIV`, `UNKNOWN`, `ENROUTE`",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Delivered": {
                    "summary": "Delivered",
                    "value": "0|DELIVRD|0912345678"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "-2|-2|can not find this serial number!"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statusCode": {
                                "type": "string"
                              },
                              "statusStr": {
                                "type": "string"
                              },
                              "cellphone": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Delivered",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statusCode": "0",
                            "statusStr": "DELIVRD",
                            "cellphone": "0912345678"
                          }
                        ]
                      }
                    }
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statuscode": "-2",
                            "statusstr": "can not find this serial number!"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statusCode": {
                            "type": "string"
                          },
                          "statusStr": {
                            "type": "string"
                          },
                          "cellphone": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "<results><result><statusCode>0</statusCode><statusStr>DELIVRD</statusStr><cellphone>0912345678</cellphone></result></results>"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "<results><r><statusCode>-2</statusCode><statusStr>can not find this serial number!</statusStr></r></results>"
                  }
                }
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    /* Handle error */\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(\"Response from server:\")\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/query.aspx?username=your_username&password=your_password&msgid=12345&dstaddr=0912345678\"))\n                .GET()\n                .build();\n\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "Query"
        ],
        "operationId": "querySmsStatusPost",
        "summary": "查詢簡訊發送狀態",
        "description": "查詢單筆簡訊的發送狀態。\n\n**statusStr 說明：** `DELIVRD`（已送達）、`REJECTD`（遭拒絕）、`EXPIRED`（已過期）、`UNDELIV`（無法送達）、`UNKNOWN`（未知）、`ENROUTE`（傳送中）",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/QuerySmsPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delivery status. Plain text: `statusCode|statusStr|cellphone`\n\n**statusStr values:** `DELIVRD`, `REJECTD`, `EXPIRED`, `UNDELIV`, `UNKNOWN`, `ENROUTE`",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Delivered",
                    "value": "0|DELIVRD|0912345678"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "-2|-2|can not find this serial number!"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statusCode": {
                                "type": "string"
                              },
                              "statusStr": {
                                "type": "string"
                              },
                              "cellphone": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Delivered",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statusCode": "0",
                            "statusStr": "DELIVRD",
                            "cellphone": "0912345678"
                          }
                        ]
                      }
                    }
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statuscode": "-2",
                            "statusstr": "can not find this serial number!"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statusCode": {
                            "type": "string"
                          },
                          "statusStr": {
                            "type": "string"
                          },
                          "cellphone": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "<results><result><statusCode>0</statusCode><statusStr>DELIVRD</statusStr><cellphone>0912345678</cellphone></result></results>"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "<results><r><statusCode>-2</statusCode><statusStr>can not find this serial number!</statusStr></r></results>"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&msgid=12345&dstaddr=0912345678' https://www.smsgo.com.tw/sms_gw/query.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"msgid\", \"12345\");\nurlencoded.append(\"dstaddr\", \"0912345678\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/query.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"msgid\", \"12345\" },\n            { \"dstaddr\", \"0912345678\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/query.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/query.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'msgid' => '12345',\n    'dstaddr' => '0912345678'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    /* Handle error */\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/query.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'msgid': '12345',\n    'dstaddr': '0912345678'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()  # Raise an exception for bad status codes\n    print(\"Response from server:\")\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/query.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&msgid=12345&dstaddr=0912345678\"))\n                .build();\n\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/queryBulk.aspx": {
      "get": {
        "tags": [
          "Query"
        ],
        "operationId": "queryBulkSmsStatusGet",
        "deprecated": true,
        "summary": "Query Bulk SMS Status (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead.\n\nQuery delivery status of multiple SMS. `msgid` and `dstaddr` are comma-separated and counts must match.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/MsgIdBulk"
          },
          {
            "$ref": "#/components/parameters/DstAddrBulk"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "Multiple records separated by `\\r\\n`. Each record: `statusCode|statusStr|cellphone|msgid`",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "0|DELIVRD|0912345678|100101121234567\r\n4|REJECTD|0987654321|100101121234568"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "-2|-2|can not find this serial number!"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statusCode": {
                                "type": "string"
                              },
                              "statusStr": {
                                "type": "string"
                              },
                              "cellphone": {
                                "type": "string"
                              },
                              "msgid": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statusCode": "0",
                            "statusStr": "DELIVRD",
                            "cellphone": "0912345678",
                            "msgid": "100101121234567"
                          },
                          {
                            "statusCode": "4",
                            "statusStr": "REJECTD",
                            "cellphone": "0987654321",
                            "msgid": "100101121234568"
                          }
                        ]
                      }
                    }
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statuscode": "-2",
                            "statusstr": "can not find this serial number!"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statusCode": {
                            "type": "string"
                          },
                          "statusStr": {
                            "type": "string"
                          },
                          "cellphone": {
                            "type": "string"
                          },
                          "msgid": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "<results><result><statusCode>0</statusCode><statusStr>DELIVRD</statusStr><cellphone>0912345678</cellphone><msgid>100101121234567</msgid></result><result><statusCode>4</statusCode><statusStr>REJECTD</statusStr><cellphone>0987654321</cellphone><msgid>100101121234568</msgid></result></results>"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "<results><r><statusCode>-2</statusCode><statusStr>can not find this serial number!</statusStr></r></results>"
                  }
                }
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx?username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321\"))\n                .GET()\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "Query"
        ],
        "operationId": "queryBulkSmsStatusPost",
        "summary": "批次查詢發送狀態",
        "description": "一次查詢多筆簡訊的發送狀態。`msgid` 與 `dstaddr` 以逗號分隔，筆數必須對應。",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/QueryBulkPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Multiple records separated by `\\r\\n`. Each record: `statusCode|statusStr|cellphone|msgid`",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "0|DELIVRD|0912345678|100101121234567\r\n4|REJECTD|0987654321|100101121234568"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "-2|-2|can not find this serial number!"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statusCode": {
                                "type": "string"
                              },
                              "statusStr": {
                                "type": "string"
                              },
                              "cellphone": {
                                "type": "string"
                              },
                              "msgid": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statusCode": "0",
                            "statusStr": "DELIVRD",
                            "cellphone": "0912345678",
                            "msgid": "100101121234567"
                          }
                        ]
                      }
                    }
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": {
                      "results": {
                        "result": [
                          {
                            "statuscode": "-2",
                            "statusstr": "can not find this serial number!"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statusCode": {
                            "type": "string"
                          },
                          "statusStr": {
                            "type": "string"
                          },
                          "cellphone": {
                            "type": "string"
                          },
                          "msgid": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "<results><result><statusCode>0</statusCode><statusStr>DELIVRD</statusStr><cellphone>0912345678</cellphone><msgid>100101121234567</msgid></result><result><statusCode>4</statusCode><statusStr>REJECTD</statusStr><cellphone>0987654321</cellphone><msgid>100101121234568</msgid></result></results>"
                  },
                  "SerialNotFound": {
                    "summary": "Serial number not found",
                    "value": "<results><r><statusCode>-2</statusCode><statusStr>can not find this serial number!</statusStr></r></results>"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321' https://www.smsgo.com.tw/sms_gw/queryBulk.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"msgid\", \"12345,12346\");\nurlencoded.append(\"dstaddr\", \"0912345678,0987654321\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"msgid\", \"12345,12346\" },\n            { \"dstaddr\", \"0912345678,0987654321\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/queryBulk.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'msgid' => '12345,12346',\n    'dstaddr' => '0912345678,0987654321'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/queryBulk.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'msgid': '12345,12346',\n    'dstaddr': '0912345678,0987654321'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/queryBulk.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&msgid=12345,12346&dstaddr=0912345678,0987654321\"))\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/queryPoint.aspx": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "queryPointsGet",
        "deprecated": true,
        "summary": "Query Remaining Points (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead.\n\nRetrieve remaining SMS point balance.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "Remaining points. Plain text returns a decimal number (e.g. `6220.0`).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "6220.0"
                  },
                  "Error": {
                    "summary": "Error",
                    "value": "Error! User name, password, serial number or ip is wrong. Please retry again!"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statuscode": {
                                "type": "string"
                              },
                              "point": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "results": {
                    "result": [
                      {
                        "statuscode": "0",
                        "point": "6220.0"
                      }
                    ]
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statuscode": {
                            "type": "string"
                          },
                          "point": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": "<results><result><statuscode>0</statuscode><point>6220.0</point></result></results>"
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx?username=your_username&password=your_password\"))\n                .GET()\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "Account"
        ],
        "operationId": "queryPointsPost",
        "summary": "查詢剩餘點數",
        "description": "查詢帳號的剩餘簡訊點數餘額。",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/QueryPointPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remaining points. Plain text: decimal number (e.g. `6220.0`).",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "6220.0"
                  },
                  "Error": {
                    "summary": "Error",
                    "value": "Error! User name, password, serial number or ip is wrong."
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "statuscode": {
                                "type": "string"
                              },
                              "point": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "results": {
                    "result": [
                      {
                        "statuscode": "0",
                        "point": "6220.0"
                      }
                    ]
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "results"
                  },
                  "properties": {
                    "result": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "statuscode": {
                            "type": "string"
                          },
                          "point": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": "<results><result><statuscode>0</statuscode><point>6220.0</point></result></results>"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password' https://www.smsgo.com.tw/sms_gw/queryPoint.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/queryPoint.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/queryPoint.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/queryPoint.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password\"))\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/sendsmsCancel.aspx": {
      "get": {
        "tags": [
          "SMS"
        ],
        "operationId": "cancelScheduledSmsGet",
        "deprecated": true,
        "summary": "Cancel Scheduled SMS (GET) ⚠ Deprecated",
        "description": "⚠ **已棄用** — 請改用 POST 方式。\n\n取消尚未發送的預約簡訊。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/MsgIdCancel"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancellation result. `0` = success.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "Success",
                    "value": "0"
                  },
                  "Error": {
                    "summary": "Error",
                    "value": "-10"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<response><code>0</code><text>Success</text></response>"
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx?username=your_username&password=your_password&msgid=12345\"))\n                .GET()\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "SMS"
        ],
        "operationId": "cancelScheduledSmsPost",
        "summary": "取消預約發送",
        "description": "取消尚未發送的預約簡訊。",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CancelSmsPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation result. `0` = success.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "0"
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<response><code>0</code><text>Success</text></response>"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&msgid=12345' https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"msgid\", \"12345\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"msgid\", \"12345\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'msgid' => '12345'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'msgid': '12345'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/sendsmsCancel.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&msgid=12345\"))\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/verify.aspx": {
      "get": {
        "tags": [
          "Verification"
        ],
        "operationId": "sendVerificationCodeGet",
        "deprecated": true,
        "summary": "Send OTP Code (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead.\n\nSend a one-time password (OTP) to a mobile number.\n\n**OTP Flow Step 1/2:** Call this → save `msgid` from response → proceed to `/verifyAck.aspx`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/DstAddr"
          },
          {
            "$ref": "#/components/parameters/CodeLength"
          },
          {
            "$ref": "#/components/parameters/DlvTime"
          },
          {
            "$ref": "#/components/parameters/ResponseCallback"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "API response. Format determined by `rtype` parameter. `statuscode=0` means success.\n\n**Error Codes:**\n\n| Code | Description |\n|:---|:---|\n| `0` | Success |\n| `-1` | CGI string error |\n| `-2` | Username, password, or IP error |\n| `-3` | Username or password empty |\n| `-5` | Phone number format error |\n| `-8` | Insufficient points |\n| `-9` | Too many recipients (max 50) |\n| `-10` | Send failed |\n| `-11` | Database error |\n| `-12` | Message body empty |\n| `-13` | Parameter count mismatch |\n| `-14` | Fraud keyword detected |\n| `-15` | IP address not allowed |\n| `-16` | API service not enabled |\n| `-17` | Callback URL not allowed |\n| `-18` | Off-net number |\n| `-19` | Number blocked |\n| `-20` | Marked as SPAM |\n| `-21` | Capacity reached |\n| `-22` | Request rerouted |\n| `-23` | No signature |\n| `-24` | OTP verification failed |\n| `-25` | OTP expired |\n| `-30` | Operator system ID error |",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": "msgid=2601270523943266\nstatuscode=0\nstatusstr=Verify success\npoint=1"
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": "msgid=-3\nstatuscode=-3\nstatusstr=username or password empty!\npoint=0"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "msgid": {
                          "type": "string"
                        },
                        "statuscode": {
                          "type": "string"
                        },
                        "statusstr": {
                          "type": "string"
                        },
                        "point": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": {
                      "result": {
                        "msgid": "2601270523943266",
                        "statuscode": "0",
                        "statusstr": "Verify success",
                        "point": 1
                      }
                    }
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": {
                      "result": {
                        "msgid": "-3",
                        "statuscode": "-3",
                        "statusstr": "username or password empty!",
                        "point": 0
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "response"
                  },
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "msgid": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": "<response><code>0</code><msgid>2601270523943266</msgid><text>Verify success</text></response>"
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": "<response><code>-3</code><msgid>-3</msgid><text>username or password empty!</text></response>"
                  }
                }
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/verify.aspx?username=your_username&password=your_password&dstaddr=0912345678\"))\n                .GET()\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "Verification"
        ],
        "operationId": "sendVerificationCodePost",
        "summary": "發送 OTP 驗證碼",
        "description": "向指定手機號碼發送一次性驗證碼（OTP）。\n\n**第 1 步（共 2 步）：** 呼叫此端點 → 儲存回傳的 `msgid` → 用戶輸入驗證碼 → 呼叫 `/verifyAck.aspx`。",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SendVerifyPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API response. Format determined by `rtype` parameter. `statuscode=0` means success.\n\n**Error Codes:**\n\n| Code | Description |\n|:---|:---|\n| `0` | Success |\n| `-1` | CGI string error |\n| `-2` | Username, password, or IP error |\n| `-3` | Username or password empty |\n| `-5` | Phone number format error |\n| `-8` | Insufficient points |\n| `-9` | Too many recipients (max 50) |\n| `-10` | Send failed |\n| `-11` | Database error |\n| `-12` | Message body empty |\n| `-13` | Parameter count mismatch |\n| `-14` | Fraud keyword detected |\n| `-15` | IP address not allowed |\n| `-16` | API service not enabled |\n| `-17` | Callback URL not allowed |\n| `-18` | Off-net number |\n| `-19` | Number blocked |\n| `-20` | Marked as SPAM |\n| `-21` | Capacity reached |\n| `-22` | Request rerouted |\n| `-23` | No signature |\n| `-24` | OTP verification failed |\n| `-25` | OTP expired |\n| `-30` | Operator system ID error |",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": "msgid=2601270523943266\nstatuscode=0\nstatusstr=Verify success\npoint=1"
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": "msgid=-3\nstatuscode=-3\nstatusstr=username or password empty!\npoint=0"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "msgid": {
                          "type": "string"
                        },
                        "statuscode": {
                          "type": "string"
                        },
                        "statusstr": {
                          "type": "string"
                        },
                        "point": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": {
                      "result": {
                        "msgid": "2601270523943266",
                        "statuscode": "0",
                        "statusstr": "Verify success",
                        "point": 1
                      }
                    }
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": {
                      "result": {
                        "msgid": "-3",
                        "statuscode": "-3",
                        "statusstr": "username or password empty!",
                        "point": 0
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "response"
                  },
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "msgid": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP sent successfully",
                    "value": "<response><code>0</code><msgid>2601270523943266</msgid><text>Verify success</text></response>"
                  },
                  "Error": {
                    "summary": "Authentication error",
                    "value": "<response><code>-3</code><msgid>-3</msgid><text>username or password empty!</text></response>"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&dstaddr=0912345678' https://www.smsgo.com.tw/sms_gw/verify.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"dstaddr\", \"0912345678\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/verify.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"dstaddr\", \"0912345678\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/verify.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/verify.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'dstaddr' => '0912345678'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/verify.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'dstaddr': '0912345678'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/verify.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&dstaddr=0912345678\"))\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    },
    "/sms_gw/verifyAck.aspx": {
      "get": {
        "tags": [
          "Verification"
        ],
        "operationId": "acknowledgeVerificationCodeGet",
        "deprecated": true,
        "summary": "Verify OTP Code (GET) ⚠ Deprecated",
        "description": "⚠ **Deprecated** — Use POST instead.\n\n**OTP Flow Step 2/2:** Validate the code entered by the user.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Username"
          },
          {
            "$ref": "#/components/parameters/Password"
          },
          {
            "$ref": "#/components/parameters/DstAddr"
          },
          {
            "$ref": "#/components/parameters/OtpCode"
          },
          {
            "$ref": "#/components/parameters/SerialNumber"
          },
          {
            "$ref": "#/components/parameters/Resend"
          },
          {
            "$ref": "#/components/parameters/DlvTime"
          },
          {
            "$ref": "#/components/parameters/ResponseCallback"
          },
          {
            "$ref": "#/components/parameters/Rtype"
          }
        ],
        "responses": {
          "200": {
            "description": "API response. Format determined by `rtype` parameter. `statuscode=0` means success.\n\n**Error Codes:**\n\n| Code | Description |\n|:---|:---|\n| `0` | Success |\n| `-1` | CGI string error |\n| `-2` | Username, password, or IP error |\n| `-3` | Username or password empty |\n| `-5` | Phone number format error |\n| `-8` | Insufficient points |\n| `-9` | Too many recipients (max 50) |\n| `-10` | Send failed |\n| `-11` | Database error |\n| `-12` | Message body empty |\n| `-13` | Parameter count mismatch |\n| `-14` | Fraud keyword detected |\n| `-15` | IP address not allowed |\n| `-16` | API service not enabled |\n| `-17` | Callback URL not allowed |\n| `-18` | Off-net number |\n| `-19` | Number blocked |\n| `-20` | Marked as SPAM |\n| `-21` | Capacity reached |\n| `-22` | Request rerouted |\n| `-23` | No signature |\n| `-24` | OTP verification failed |\n| `-25` | OTP expired |\n| `-30` | Operator system ID error |",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": "msgid=2603160424021870\nstatuscode=0\nstatusstr=OK\npoint=0"
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": "msgid=-24\nstatuscode=-24\nstatusstr=Verify Fail\npoint=0"
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": "msgid=-25\nstatuscode=-25\nstatusstr=Verify Expired\npoint=0"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "msgid": {
                          "type": "string"
                        },
                        "statuscode": {
                          "type": "string"
                        },
                        "statusstr": {
                          "type": "string"
                        },
                        "point": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": {
                      "result": {
                        "msgid": "2603160424021870",
                        "statuscode": "0",
                        "statusstr": "OK",
                        "point": 0
                      }
                    }
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": {
                      "result": {
                        "msgid": "-24",
                        "statuscode": "-24",
                        "statusstr": "Verify Fail",
                        "point": 0
                      }
                    }
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": {
                      "result": {
                        "msgid": "-25",
                        "statuscode": "-25",
                        "statusstr": "Verify Expired",
                        "point": 0
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "response"
                  },
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "msgid": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": "<response><code>0</code><msgid>2603160424021870</msgid><text>OK</text></response>"
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": "<response><code>-24</code><msgid>-24</msgid><text>Verify Fail</text></response>"
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": "<response><code>-25</code><msgid>-25</msgid><text>Verify Expired</text></response>"
                  }
                }
              }
            }
          }
        },
        "x-internal": true,
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl \"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890\""
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "fetch('https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890', {\n    method: 'GET'\n})\n.then(response => response.text())\n.then(result => console.log(result))\n.catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program\n{\n    static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var request = new HttpRequestMessage(HttpMethod.Get, \"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890\");\n        var response = await client.SendAsync(request);\n        response.EnsureSuccessStatusCode();\n        Console.WriteLine(await response.Content.ReadAsStringAsync());\n    }\n}"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890';\n$result = file_get_contents($url);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890'\n\ntry:\n    response = requests.get(url)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx?username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890\"))\n                .GET()\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      },
      "post": {
        "tags": [
          "Verification"
        ],
        "operationId": "acknowledgeVerificationCodePost",
        "summary": "驗證 OTP 代碼",
        "description": "驗證用戶輸入的 OTP 代碼是否正確。\n\n**第 2 步（共 2 步）：**\n- `serial_number` = 發送 OTP 時取得的 `msgid`\n- `OtpCode` = 用戶收到的驗證碼\n- `-24`：驗證碼錯誤；`-25`：已過期（設 `resend=true` 可自動重送）",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/AckVerifyPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API response. Format determined by `rtype` parameter. `statuscode=0` means success.\n\n**Error Codes:**\n\n| Code | Description |\n|:---|:---|\n| `0` | Success |\n| `-1` | CGI string error |\n| `-2` | Username, password, or IP error |\n| `-3` | Username or password empty |\n| `-5` | Phone number format error |\n| `-8` | Insufficient points |\n| `-9` | Too many recipients (max 50) |\n| `-10` | Send failed |\n| `-11` | Database error |\n| `-12` | Message body empty |\n| `-13` | Parameter count mismatch |\n| `-14` | Fraud keyword detected |\n| `-15` | IP address not allowed |\n| `-16` | API service not enabled |\n| `-17` | Callback URL not allowed |\n| `-18` | Off-net number |\n| `-19` | Number blocked |\n| `-20` | Marked as SPAM |\n| `-21` | Capacity reached |\n| `-22` | Request rerouted |\n| `-23` | No signature |\n| `-24` | OTP verification failed |\n| `-25` | OTP expired |\n| `-30` | Operator system ID error |",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": "msgid=2603160424021870\nstatuscode=0\nstatusstr=OK\npoint=0"
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": "msgid=-24\nstatuscode=-24\nstatusstr=Verify Fail\npoint=0"
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": "msgid=-25\nstatuscode=-25\nstatusstr=Verify Expired\npoint=0"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "msgid": {
                          "type": "string"
                        },
                        "statuscode": {
                          "type": "string"
                        },
                        "statusstr": {
                          "type": "string"
                        },
                        "point": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": {
                      "result": {
                        "msgid": "2603160424021870",
                        "statuscode": "0",
                        "statusstr": "OK",
                        "point": 0
                      }
                    }
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": {
                      "result": {
                        "msgid": "-24",
                        "statuscode": "-24",
                        "statusstr": "Verify Fail",
                        "point": 0
                      }
                    }
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": {
                      "result": {
                        "msgid": "-25",
                        "statuscode": "-25",
                        "statusstr": "Verify Expired",
                        "point": 0
                      }
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "xml": {
                    "name": "response"
                  },
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "msgid": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "summary": "OTP verified successfully",
                    "value": "<response><code>0</code><msgid>2603160424021870</msgid><text>OK</text></response>"
                  },
                  "VerifyFail": {
                    "summary": "Wrong OTP code (-24)",
                    "value": "<response><code>-24</code><msgid>-24</msgid><text>Verify Fail</text></response>"
                  },
                  "VerifyExpired": {
                    "summary": "OTP expired (-25)",
                    "value": "<response><code>-25</code><msgid>-25</msgid><text>Verify Expired</text></response>"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "cURL",
            "label": "cURL",
            "source": "curl -X POST -d 'username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890' https://www.smsgo.com.tw/sms_gw/verifyAck.aspx"
          },
          {
            "lang": "JavaScript",
            "label": "JavaScript",
            "source": "const myHeaders = new Headers();\nmyHeaders.append(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\nconst urlencoded = new URLSearchParams();\nurlencoded.append(\"username\", \"your_username\");\nurlencoded.append(\"password\", \"your_password\");\nurlencoded.append(\"dstaddr\", \"0912345678\");\nurlencoded.append(\"OtpCode\", \"123456\");\nurlencoded.append(\"serial_number\", \"1234567890\");\n\nconst requestOptions = {\n  method: 'POST',\n  headers: myHeaders,\n  body: urlencoded,\n  redirect: 'follow'\n};\n\nfetch(\"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx\", requestOptions)\n  .then(response => response.text())\n  .then(result => console.log(result))\n  .catch(error => console.log('error', error));"
          },
          {
            "lang": "C#",
            "label": "C#",
            "source": "using System;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class SmsGoExample\n{\n    public static async Task Main(string[] args)\n    {\n        var client = new HttpClient();\n        var values = new Dictionary<string, string>\n        {\n            { \"username\", \"your_username\" },\n            { \"password\", \"your_password\" },\n            { \"dstaddr\", \"0912345678\" },\n            { \"OtpCode\", \"123456\" },\n            { \"serial_number\", \"1234567890\" }\n        };\n\n        var content = new FormUrlEncodedContent(values);\n        var response = await client.PostAsync(\"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx\", content);\n        var responseString = await response.Content.ReadAsStringAsync();\n\n        Console.WriteLine(responseString);\n    }\n}\n"
          },
          {
            "lang": "PHP",
            "label": "PHP",
            "source": "<?php\n\n$url = 'https://www.smsgo.com.tw/sms_gw/verifyAck.aspx';\n$data = array(\n    'username' => 'your_username',\n    'password' => 'your_password',\n    'dstaddr' => '0912345678',\n    'OtpCode' => '123456',\n    'serial_number' => '1234567890'\n);\n\n$options = array(\n    'http' => array(\n        'header'  => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n        'method'  => 'POST',\n        'content' => http_build_query($data)\n    )\n);\n$context  = stream_context_create($options);\n$result = file_get_contents($url, false, $context);\n\nif ($result === FALSE) {\n    echo \"Error sending request.\";\n}\n\nvar_dump($result);\n\n?>\n"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nurl = 'https://www.smsgo.com.tw/sms_gw/verifyAck.aspx'\npayload = {\n    'username': 'your_username',\n    'password': 'your_password',\n    'dstaddr': '0912345678',\n    'OtpCode': '123456',\n    'serial_number': '1234567890'\n}\n\ntry:\n    response = requests.post(url, data=payload)\n    response.raise_for_status()\n    print(response.text)\nexcept requests.exceptions.RequestException as e:\n    print(f\"An error occurred: {e}\")\n"
          },
          {
            "lang": "Java",
            "label": "Java",
            "source": "import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class SmsGoExample {\n    public static void main(String[] args) throws Exception {\n        HttpClient client = HttpClient.newHttpClient();\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https://www.smsgo.com.tw/sms_gw/verifyAck.aspx\"))\n                .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n                .POST(HttpRequest.BodyPublishers.ofString(\"username=your_username&password=your_password&dstaddr=0912345678&OtpCode=123456&serial_number=1234567890\"))\n                .build();\n        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\n        System.out.println(response.body());\n    }\n}"
          }
        ]
      }
    }
  }
}