SMS API (1.5.1)
Download OpenAPI specification:
With the SMS API you can send SMS from your account and lookup messages both messages that you've sent as well as messages sent to your virtual numbers. Numbers are specified in E.164 format. More SMS API documentation is at https://developer.vonage.com/messaging/sms/overview
Send an SMS
Send an outbound SMS from your Vonage account
Authorizations:
path Parameters
| format required | string Default: "json" Enum: "json" "xml" Example: json The format of the response |
Request Body schema: application/x-www-form-urlencodedrequired
| api_key | string = 8 characters Your API key. Only required if setting |
| sig | string [ 16 .. 60 ] characters The hash of the request parameters in alphabetical order, a timestamp and the signature secret. See Signing Requests for more details.
Note: DO NOT set an |
| timestamp | integer An integer containing the number of seconds since the epoch (this is sometimes also known as UNIX time). Only required if setting |
| from required | string The name or number the message should be sent from. Alphanumeric senderID's are not supported in all countries, see Global Messaging for more details. If alphanumeric, spaces will be ignored. Numbers are specified in E.164 format. |
| to required | string [ 7 .. 15 ] characters \d{7,15} The number that the message should be sent to. Numbers are specified in E.164 format. |
| text required | string The body of the message being sent. If your message contains characters that can be encoded according to the GSM Standard and Extended tables then you can set the |
| ttl | integer [ 20000 .. 604800000 ] Default: 259200000 Advanced: The duration in milliseconds the delivery of an SMS will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes. |
| status-report-req | |
| callback | string Advanced: The webhook endpoint the delivery receipt for this sms is sent to. This parameter overrides the webhook endpoint you set in Dashboard. Max 100 characters. |
| message-class | integer Enum: 0 1 2 3 Advanced: The Data Coding Scheme value of the message |
| type | string Default: "text" Enum: "text" "binary" "unicode" Advanced: The format of the message body |
| body | string Advanced: Hex encoded binary data. Depends on |
| udh | string Advanced: Your custom Hex encoded User Data Header. Depends on |
| protocol-id | integer Advanced: The value of the protocol identifier to use. Ensure that the value is aligned with |
| client-ref | string Advanced: You can optionally include your own reference of up to 100 characters. |
| account-ref | string Advanced: An optional string used to identify separate accounts using the SMS endpoint for billing purposes. To use this feature, please email support |
| entity-id | string Advanced: A string parameter that satisfies regulatory requirements when sending an SMS to specific countries. For more information please refer to the Country-Specific Outbound SMS Features |
| content-id | string Advanced: A string parameter that satisfies regulatory requirements when sending an SMS to specific countries. For more information please refer to the Country-Specific Outbound SMS Features |
| trusted-number | boolean Default: false Setting this parameter to This parameter only has any effect for accounts subscribed to Fraud Defender Premium. |
| pool-id | string The ID of the Number Pool to use as the sender of this message. If specified, a number from the pool will be used as the |
Responses
Callbacks
Response samples
- 200
{- "message-count": "1",
- "messages": [
- {
- "to": "447700900000",
- "message-id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
- "status": "0",
- "remaining-balance": "3.14159265",
- "message-price": "0.03330000",
- "network": "12345",
- "client-ref": "my-personal-reference",
- "account-ref": "customer1234"
}
]
}Callback payload samples
{- "msisdn": "447700900000",
- "to": "AcmeInc",
- "network-code": "12345",
- "messageId": "0A0000001234567B",
- "price": "0.03330000",
- "status": "delivered",
- "scts": "2001011400",
- "err-code": "0",
- "api-key": "abcd1234",
- "message-timestamp": "2020-01-01 12:00:00",
- "client-ref": "my-personal-reference"
}