Curl for posting message to US number:
curl -X POST "https://rest.nexmo.com/sms/json" -d "from=1XXXXXXXXXX" -d "text=A text message set using the Nexmo SMS API" -d "to=1XXXXXXXXXX" -d "api_key=my_api_key" -d "api_secret=my_api_secret"
Response:
{
"message-count": "1",
"messages": [{
"to": "1XXXXXXXXXX",
"status": "15",
"error-text": "Illegal Sender Address - rejected",
"network": "XXXXXX"
}]
}
Curl for posting message to Indian number:
curl -X POST "https://rest.nexmo.com/sms/json" -d "from=1XXXXXXXXXX" -d "text=A text message set using the Nexmo SMS API" -d "to=91XXXXXXXXXX" -d "api_key=my_api_key" -d "api_secret=my_api_secret"
Response:
{
"message-count": "1",
"messages": [{
"to": "91XXXXXXXXXX",
"message-id": "0F000XXXXF05XXX6",
"status": "0",
"remaining-balance": "48.96XXXXXX",
"message-price": "0.00800000",
"network": "XXXXX"
}]
}
This was working fine for both US and Indian Number, but recently it is giving me Illegal Sender Address - rejected
error.
Has nexmo changed anything?
Please see this page for restrictions on USA SMS features: https://help.nexmo.com/hc/en-us/articles/204017023-USA-SMS-Features-Restrictions
Specifically:
"All SMS sent to the US must originate from either a U.S. pre-approved long number or short code that is associated with your Nexmo account. Alpha sender IDs are not supported."