Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the request for numverify scan #1072

Merged
merged 4 commits into from
Jun 19, 2022

Conversation

kriss-u
Copy link
Contributor

@kriss-u kriss-u commented Jun 11, 2022

Previously, the API endpoint to perform a numverify scan was as follows.

GET https://apilayer.net/api/validate?access_key=access_key&number=phone_number

This has been changed to the following.

GET https://api.apilayer.com/number_verification/validate?number=phone_number
apikey: access_key

I still don't know why the previous endpoint gets a hit and returns a response but doesn't do the verification job. The following is the screenshot after making the change. No automation tests are run.

Resolves #1056

image

Copy link
Owner

@sundowndev sundowndev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to fix this 🙏🏻

You just need to fix tests now, feel free to ask if you need help on that.

@kriss-u
Copy link
Contributor Author

kriss-u commented Jun 16, 2022

@sundowndev I updated the tests to match the new URLs. However, the tests are failing, maybe because of the API keys. Can you please pull this branch and check what needs to be done.

@sundowndev
Copy link
Owner

sundowndev commented Jun 19, 2022

Hey @kriss-u I took a look and it seems that the Go http lib transforms the header key to camel case, so the apikey header key becomes Apikey.

Change this in the tests and it should pass :

-               MatchHeader("apikey", "...").
+               MatchHeader("Apikey", "...").

@kriss-u
Copy link
Contributor Author

kriss-u commented Jun 19, 2022

@sundowndev It should work now. I had also forgotten to change the server test to mock the response. The tests didn't fail afterwards. Thanks for the help!

Copy link
Owner

@sundowndev sundowndev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for spending time on this 🙏🏻 ❤️

@sundowndev sundowndev merged commit fdd163d into sundowndev:master Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numverifiy API key isn't working?
2 participants