In this Lookup API Quickstart, we'll show you how to programmatically request a number Lookup via the Lookup API.
Before we get started, log in to the MessageBird Connectivity Platform and collect your live API key from the Developer Dashboard.
Next, enter your credentials and mobile number - as both the originator and recipient - to the below snippet and copy it to your terminal. Now, hit enter!
curl -X GET https://rest.messagebird.com/lookup/31XXXXXXXXX \-H 'Authorization: AccessKey YOUR-API-KEY'
You’ve requested a Lookup with the Lookup API!
Now, let’s view MessageBird’s HTTP response to your API call. If the set up was correct, you will receive a response similar to this:
{"href":"https:\/\/rest.messagebird.com\/lookup\/31XXXXXXXXX","countryCode":"NL","countryPrefix":31,"phoneNumber":31XXXXXXXXX,"type":"mobile","formats":{"e164":"+31XXXXXXXXX","international":"+31 6 12345678","national":"06 12345678","rfc3966":"tel:+31-6-12345678"}}
If something went wrong, you’ll receive an error response from the API. Don't worry, head over to Troubleshooting Lookup to understand the error.
Congrats! You can now programmatically request a Lookup with Lookup API using cURL.