Emulate Vonage (formerly Nexmo)

Learn how to quickly modify your existing Vonage API calls to send SMS messages using the SMS Gateway Emulator app. With minimal code changes, you can switch from Vonage services to our app, saving costs and gaining full control over your SMS gateway.

There are 2 ways to emulate Vonage API.

  1. Change the API url directly.

  2. Via our Proxy Server.

Whatever you do, make sure to change the API_KEY, API_SECRET to EMULATOR_API_KEY, EMULATOR_API_SECRET, and set EMULATOR_SENDER_ID.

Vonage Official Documents

https://developer.vonage.com/en/messages/overview
https://developer.vonage.com/en/getting-started/concepts/authentication#basic-authentication

There are two versions of the Messages API available

https://developer.vonage.com/en/api/messages.v0
https://developer.vonage.com/en/api/messages

Only Basic authentication is supported.

curl

# Version 0
curl -X POST https://api.nexmo.com/v0.1/messages \
     -u "$VONAGE_API_KEY:$VONAGE_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "from": { "type": "sms", "number": "'$FROM_NUMBER'" },
          "to": { "type": "sms", "number": "'$TO_NUMBER'" },
          "message": {
            "content": {
              "type": "text",
              "text": "This is an SMS sent from the Messages API"
        }
   }
}'

# Version 1
curl -X POST https://api.nexmo.com/v1/messages \
     -u "$VONAGE_API_KEY:$VONAGE_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "message_type": "text",
          "text": "This is an SMS sent from the Messages API",
          "to": "'$TO_NUMBER'",
          "from": "'$FROM_NUMBER'",
          "channel": "sms"
        }'
# Version 0
curl -X POST https://api.smsgatewayemulator.com/v0.1/messages \
     -u "$EMULATOR_API_KEY:$EMULATOR_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "from": { "type": "sms", "number": "'$EMULATOR_SENDER_ID'" },
          "to": { "type": "sms", "number": "'$TO_NUMBER'" },
          "message": {
            "content": {
              "type": "text",
              "text": "This is an SMS sent from the Messages API"
        }
   }
}'

# Version 1
curl -X POST https://api.smsgatewayemulator.com/v1/messages \
     -u "$EMULATOR_API_KEY:$EMULATOR_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "message_type": "text",
          "text": "This is an SMS sent from the Messages API",
          "to": "'$TO_NUMBER'",
          "from": "'$EMULATOR_SENDER_ID'",
          "channel": "sms"
        }'
# Version 0
curl -X POST https://api.nexmo.com/v0.1/messages \
     -u "$EMULATOR_API_KEY:$EMULATOR_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "from": { "type": "sms", "number": "'$EMULATOR_SENDER_ID'" },
          "to": { "type": "sms", "number": "'$TO_NUMBER'" },
          "message": {
            "content": {
              "type": "text",
              "text": "This is an SMS sent from the Messages API"
        }
   }
}' \
--cacert ./sms_gateway_emulator_ca.crt \
--proxy https://proxy.smsgatewayemulator.com \
--proxy-cacert ./sms_gateway_emulator_ca.crt

# Version 1
curl -X POST https://api.nexmo.com/v1/messages \
     -u "$EMULATOR_API_KEY:$EMULATOR_API_SECRET" \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d $'{
          "message_type": "text",
          "text": "This is an SMS sent from the Messages API",
          "to": "'$TO_NUMBER'",
          "from": "'$EMULATOR_SENDER_ID'",
          "channel": "sms"
        }' \
--cacert ./sms_gateway_emulator_ca.crt \
--proxy https://proxy.smsgatewayemulator.com \
--proxy-cacert ./sms_gateway_emulator_ca.crt

Python

from vonage import Auth, Vonage
from vonage_sms import SmsMessage, SmsResponse

client = Vonage(Auth(api_key=VONAGE_API_KEY, api_secret=VONAGE_API_SECRET))

message = SmsMessage(
    to=TO_NUMBER,
    from_=VONAGE_BRAND_NAME,
    text="A text message sent using the Vonage SMS API.",
)

response: SmsResponse = client.sms.send(message)
print(response)
from vonage import Auth, Vonage
from vonage_sms import SmsMessage, SmsResponse

# The SDK sends the request to rest_host instead of api_host
client = Vonage(Auth(api_key=EMULATOR_API_KEY, api_secret=EMULATOR_API_SECRET), HttpClientOptions(api_host='api.smsgatewayemulator.com', rest_host='api.smsgatewayemulator.com'))

message = SmsMessage(
    to=TO_NUMBER,
    from_=EMULATOR_SENDER_ID,
    text="A text message sent using the Vonage SMS API.",
)

response: SmsResponse = client.sms.send(message)
print(response)


< Home page



© 2024 SMS Gateway Emulator
Privacy Policy | Terms of Use