3

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?

r_D
  • 578
  • 1
  • 7
  • 16
  • 2
    [In the “from” field you need to specify your ***pre-approved*** US virtual number in international format e.g. 13036320365 (available in the Numbers tab) . Otherwise your message will get rejected with reject code 15 Illegal Sender Address - rejected.](https://help.nexmo.com/hc/en-us/articles/204017023-USA-SMS-Features-Restrictions) – Joachim Isaksson Jun 20 '19 at 06:38
  • I am using sender number in international format. This was working in February 2019 (It was the last time I checked). Was this some recent change? – r_D Jun 20 '19 at 06:43
  • If the number is pre-approved, there should have been no change and you're probably better off contacting support. If it's not, I'm not sure if there have been any recent changes for the US specifically. – Joachim Isaksson Jun 20 '19 at 07:05
  • Thanks @JoachimIsaksson, it worked. I purchased pre-approved number from Nexmo. – r_D Jun 20 '19 at 09:07

1 Answers1

6

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."

Paul Ardeleanu
  • 6,620
  • 2
  • 40
  • 41