{
  "openapi": "3.0.0",
  "info": {
    "title": "SMSGO SMS Gateway API",
    "description": "Send SMS messages through the SMSGO platform via HTTP POST.\n\n---\n\n**Key Features:**\n\n- **Multiple Encodings:** `BIG5` (Traditional Chinese), `ASCII`, `UCS2` (Unicode).\n- **Long SMS:** Up to 335 characters.\n- **WAP Push:** Send links to mobile devices.\n- **Scheduled Delivery:** Schedule future sends.\n- **Callbacks:** Webhooks for delivery status and user replies.\n\n---\n\n**Notes:**\n\n1. `BIG5`/`ASCII`/`UCS2` support single SMS only. Messages exceeding the limit are auto-truncated.\n2. `PBIG5`/`PASCII` are POPUP. `LBIG5`/`LASCII`/`LUCS2` are long SMS (max 335 Chinese chars).\n3. For `PUSH`, `smbody`+`wapurl` combined must be ≤ 88 bytes (Chinese chars count as 3 bytes).\n4. Setting `replyurl` enables SMS reply at +1 point per 10 messages (max URL length: 300 chars).\n5. International SMS: only `BIG5`/`ASCII`/`UCS2`. Use `UCS2` for Simplified Chinese.\n> ⚠️ **Important:** To use this API, you will need to contact customer support to enable it.\n\n---\n\n**Contact:**\n\n- 💬 LINE: [@cdn4573o](https://line.me/R/ti/p/@cdn4573o)",
    "version": "1.6.4",
    "contact": {
      "name": "SMSGO Support",
      "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": "Operations for sending and managing SMS messages."
    },
    {
      "name": "Query",
      "description": "Operations for querying message delivery status."
    },
    {
      "name": "Account",
      "description": "Operations for managing account settings and points."
    },
    {
      "name": "Verification",
      "description": "Operations for sending and verifying one-time passwords (OTP)."
    }
  ],
  "components": {
    "parameters": {
      "Username": {
        "name": "username",
        "in": "query",
        "required": true,
        "description": "Member account username",
        "schema": {
          "type": "string",
          "example": "your_username"
        }
      },
      "Password": {
        "name": "password",
        "in": "query",
        "required": true,
        "description": "Member password or API Key",
        "schema": {
          "type": "string",
          "format": "password",
          "example": "your_password"
        }
      },
      "DstAddr": {
        "name": "dstaddr",
        "in": "query",
        "required": true,
        "description": "Recipient mobile number(s). Multiple numbers comma-separated (max 50). Domestic: 09xxxxxxxx. International: prefix with `+` URL-encoded as `%2b`, e.g. `%2b8613681912700`.",
        "schema": {
          "type": "string",
          "example": "0912345678"
        }
      },
      "DstAddrBulk": {
        "name": "dstaddr",
        "in": "query",
        "required": true,
        "description": "One or more phone numbers separated by commas. Count must match `msgid`.",
        "schema": {
          "type": "string",
          "example": "0912345678,0987654321"
        }
      },
      "SmBody": {
        "name": "smbody",
        "in": "query",
        "required": true,
        "description": "SMS content. Max 70 chars (zh/en mix) or 160 chars (ASCII). Long SMS (`L*` encodings): max 335 chars. WAP Push (`PUSH`): this is the push title; `smbody`+`wapurl` ≤ 88 bytes.",
        "schema": {
          "type": "string",
          "example": "Hello from SMSGO"
        }
      },
      "Encoding": {
        "name": "encoding",
        "in": "query",
        "required": false,
        "description": "Message encoding. Default: `BIG5`.\n\n| Value | Description |\n|---|---|\n| `BIG5` | Traditional Chinese, single SMS, max 70 chars |\n| `ASCII` | English only, single SMS, max 160 chars |\n| `UCS2` | Unicode (Japanese, Korean, Simplified Chinese) |\n| `PBIG5` | POPUP Traditional Chinese |\n| `PASCII` | POPUP English |\n| `LBIG5` | Long SMS Traditional Chinese, max 335 chars |\n| `LASCII` | Long SMS English |\n| `LUCS2` | Long SMS Unicode |\n| `PUSH` | WAP Push (requires `wapurl`) |",
        "schema": {
          "type": "string",
          "default": "BIG5",
          "enum": [
            "BIG5",
            "ASCII",
            "UCS2",
            "PBIG5",
            "PASCII",
            "LBIG5",
            "LASCII",
            "LUCS2",
            "PUSH"
          ]
        }
      },
      "DlvTime": {
        "name": "dlvtime",
        "in": "query",
        "required": false,
        "description": "Scheduled delivery time. Format: `YYYY/MM/DD hh24:mm:ss`. Leave blank to send immediately.",
        "schema": {
          "type": "string",
          "example": "2026/12/31 09:00:00"
        }
      },
      "WapUrl": {
        "name": "wapurl",
        "in": "query",
        "required": false,
        "description": "WAP Push destination URL. Only used when `encoding=PUSH`. Combined with `smbody` must be ≤ 88 bytes.",
        "schema": {
          "type": "string",
          "format": "uri",
          "example": "https://www.example.com"
        }
      },
      "ReplyUrl": {
        "name": "replyurl",
        "in": "query",
        "required": false,
        "description": "Callback URL to receive user reply messages (extra charge: +1 point per 10 messages). Only for `BIG5`/`ASCII`/`UCS2`. Max 300 characters.",
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "ReplyDays": {
        "name": "replydays",
        "in": "query",
        "required": false,
        "description": "Number of days to collect user replies. Default: 3, Max: 30. Only for `BIG5`/`ASCII`/`UCS2`.",
        "schema": {
          "type": "integer",
          "default": 3,
          "minimum": 1,
          "maximum": 30
        }
      },
      "ResponseCallback": {
        "name": "response",
        "in": "query",
        "required": false,
        "description": "Callback URL for delivery status reports. System POSTs status updates to this URL. Leave blank to disable.",
        "schema": {
          "type": "string",
          "format": "uri"
        }
      },
      "Rtype": {
        "name": "rtype",
        "in": "query",
        "required": false,
        "description": "Response format. Omit for plain text, `JSON` for JSON, `XML` for XML.",
        "schema": {
          "type": "string",
          "enum": [
            "JSON",
            "XML"
          ]
        }
      },
      "MsgId": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "Message ID returned from a successful send request.",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "MsgIdBulk": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "One or more message IDs separated by commas. Count must match `dstaddr`.",
        "schema": {
          "type": "string",
          "example": "100101121234567,100101121234568"
        }
      },
      "MsgIdCancel": {
        "name": "msgid",
        "in": "query",
        "required": true,
        "description": "Message ID of the scheduled SMS to cancel.",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "CodeLength": {
        "name": "codelength",
        "in": "query",
        "required": false,
        "description": "Length of the OTP verification code. Can be `4` or `6`. Default: `4`.",
        "schema": {
          "type": "integer",
          "enum": [
            4,
            6
          ],
          "default": 4
        }
      },
      "OtpCode": {
        "name": "OtpCode",
        "in": "query",
        "required": true,
        "description": "The OTP code entered by the user (4 or 6 digits).",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{4,6}$",
          "example": "123456"
        }
      },
      "SerialNumber": {
        "name": "serial_number",
        "in": "query",
        "required": true,
        "description": "The `msgid` returned from the Send OTP (`/verify.aspx`) request.",
        "schema": {
          "type": "string",
          "example": "100101121234567"
        }
      },
      "Resend": {
        "name": "resend",
        "in": "query",
        "required": false,
        "description": "Set to `true` to automatically resend a new OTP if the current one has expired (statuscode `-25`).",
        "schema": {
          "type": "boolean"
        }
      }
    },
    "schemas": {
      "AuthFields": {
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string",
            "description": "Member account username",
            "example": "your_username"
          },
          "password": {
            "type": "string",
            "format": "password",
            "description": "Member password or 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": "Recipient number(s), comma-separated, max 50",
                "example": "0912345678"
              },
              "smbody": {
                "type": "string",
                "description": "SMS content",
                "example": "Hello from SMSGO API"
              },
              "encoding": {
                "type": "string",
                "default": "BIG5",
                "enum": [
                  "BIG5",
                  "ASCII",
                  "UCS2",
                  "PBIG5",
                  "PASCII",
                  "LBIG5",
                  "LASCII",
                  "LUCS2",
                  "PUSH"
                ]
              },
              "dlvtime": {
                "type": "string",
                "description": "Scheduled time: YYYY/MM/DD hh24:mm:ss",
                "example": "2026/12/31 09:00:00"
              },
              "wapurl": {
                "type": "string",
                "format": "uri",
                "description": "WAP Push URL (encoding=PUSH only)"
              },
              "replyurl": {
                "type": "string",
                "format": "uri",
                "description": "Reply callback URL (extra charge, max 300 chars)"
              },
              "replydays": {
                "type": "integer",
                "default": 3,
                "minimum": 1,
                "maximum": 30,
                "description": "Days to collect replies (1–30)"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "Status report callback URL"
              },
              "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": "Message ID from send response",
                "example": "100101121234567"
              },
              "dstaddr": {
                "type": "string",
                "description": "Recipient phone number",
                "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": "Comma-separated message IDs",
                "example": "100101121234567,100101121234568"
              },
              "dstaddr": {
                "type": "string",
                "description": "Comma-separated phone numbers (count must match 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": "Message ID to cancel",
                "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": "Recipient phone number",
                "example": "0912345678"
              },
              "codelength": {
                "type": "integer",
                "enum": [
                  4,
                  6
                ],
                "default": 4,
                "description": "OTP length: 4 or 6"
              },
              "dlvtime": {
                "type": "string",
                "description": "Scheduled time: YYYY/MM/DD hh24:mm:ss"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "Status callback URL"
              },
              "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": "Recipient phone number",
                "example": "0912345678"
              },
              "OtpCode": {
                "type": "string",
                "pattern": "^[0-9]{4,6}$",
                "description": "OTP code entered by user",
                "example": "123456"
              },
              "serial_number": {
                "type": "string",
                "description": "msgid from Send OTP response",
                "example": "100101121234567"
              },
              "resend": {
                "type": "boolean",
                "description": "Resend new OTP if expired (statuscode -25)"
              },
              "dlvtime": {
                "type": "string",
                "description": "Resend scheduled time"
              },
              "response": {
                "type": "string",
                "format": "uri",
                "description": "Resend status callback URL"
              },
              "rtype": {
                "type": "string",
                "enum": [
                  "JSON",
                  "XML"
                ],
                "description": "Response format"
              }
            }
          }
        ]
      }
    },
    "responses": {
      "SmsApiResponse": {
        "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": "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 Send SMS 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": "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": "Send SMS (POST)",
        "description": "Send an SMS message. Content-Type must be `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": "Query SMS Status (POST)",
        "description": "Query delivery status of a single SMS via POST.",
        "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": "Query Bulk SMS Status (POST)",
        "description": "Query delivery status of multiple SMS via POST. `msgid` and `dstaddr` are comma-separated and counts must match.",
        "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": "Query Remaining Points (POST)",
        "description": "Retrieve remaining SMS point balance via POST.",
        "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": "⚠ **Deprecated** — Use POST instead.\n\nCancel a previously scheduled SMS that has not yet been sent.",
        "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": "Cancel Scheduled SMS (POST)",
        "description": "Cancel a previously scheduled SMS that has not yet been sent.",
        "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": "Send OTP Code (POST)",
        "description": "Send a one-time password (OTP) to a mobile number.\n\n**OTP Flow Step 1/2:** Call this → save `msgid` from response → user enters code → call `/verifyAck.aspx` with `serial_number=msgid`.",
        "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": "Verify OTP Code (POST)",
        "description": "**OTP Flow Step 2/2:** Validate the OTP code entered by the user.\n\n- `serial_number` = `msgid` from the Send OTP response\n- `OtpCode` = 4 or 6 digit code the user received\n- statuscode `-24` = wrong code, `-25` = expired (set `resend=true` to auto-resend)",
        "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}"
          }
        ]
      }
    }
  }
}