Closed leggetter closed 7 years ago
In the latest release of nexmo
, the call get_number_insight
is deprecated - it calls the old endpoint "number/lookup/json", so it isn't equivalent to the curl request above.
The modified curl request looks like this (and gets the 503):
curl -i "https://api.nexmo.com/number/lookup/json" -d "api_key=KEY" -d "api_secret=SECRET" -d "number=351914XXXXXX"
HTTP/1.1 503 Service Unavailable
Date: Mon, 17 Jul 2017 14:55:28 GMT
Server: PWS/8.2.1.6.5
X-Px: nc h0-s4009.p6-lhr ( h0-s1019.p1-iad), nc h0-s1019.p1-iad ( origin>ste)
Px-503: O socket timeout
Content-Length: 53
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
<html><body>Not found (error to origin)</body></html>
Use get_basic_number_insight
instead.
I've just confirmed that the curl request in my comment above works for a UK number, but not for portuguese numbers, so it looks like a limitation of the deprecated service.
So the fix for this is for the user to use get_basic_number_insight
. The old API won't work for this country.
Retrieving NI for a Portuguese number returns a 503 when executing this sample code: https://github.com/nexmo-community/nexmo-python-quickstart/commit/21c02b938dfc13ffa3af53c50ea724e629538efd
However, the cURL with this number seems to work:
So right now this looks like a problem with the Nexmo Python library. I don't know why we only see this problem with the Portuguese numbers, but the same code works with a UK number.