messagemedia / lookups-sdk
The MessageMedia Lookups API provides a number of endpoints for validating the phone numbers youโre sending to by checking their validity, type and carrier records.
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- apimatic/jsonmapper: ~1.3.0
- mashape/unirest-php: ~3.0.1
Requires (Dev)
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: ^2.7
This package is auto-updated.
Last update: 2025-01-16 20:22:41 UTC
README
The MessageMedia Lookups API provides a number of endpoints for validating the phone numbers youโre sending to by checking their validity, type and carrier records.
Table of Contents
๐ Authentication
Authentication is done via API keys. Sign up at https://developers.messagemedia.com/register/ to get your API keys.
Requests are authenticated using HTTP Basic Auth or HMAC. Provide your API key as the auth_user_name and API secret as the auth_password.
โ๏ธ Errors
Our API returns standard HTTP success or error status codes. For errors, we will also include extra information about what went wrong encoded in the response as JSON. The most common status codes are listed below.
HTTP Status Codes
๐ฐ Information
Slack and Mailing List
If you have any questions, comments, or concerns, please join our Slack channel: https://developers.messagemedia.com/collaborate/slack/
Alternatively you can email us at: developers@messagemedia.com
Bug reports
If you discover a problem with the SDK, we would like to know about it. You can raise an issue or send an email to: developers@messagemedia.com
Contributing
We welcome your thoughts on how we could best provide you with SDKs that would simplify how you consume our services in your application. You can fork and create pull requests for any features you would like to see or raise an issue
โญ Installation
Now install messagemedia-lookups-sdk via composer by using the following to your composer.json file:
composer require messagemedia/lookups-sdk
๐ฌ Get Started
It's easy to get started. Simply enter the API Key and secret you obtained from the MessageMedia Developers Portal into the code snippet below and a mobile number you wish to send to.
Lookup a number
<?php require_once "vendor/autoload.php"; $basicAuthUserName = 'YOUR_API_KEY'; // The username to use with basic authentication $basicAuthPassword = 'YOUR_SECRET_KEY'; // The password to use with basic authentication $client = new MessageMediaLookupsLib\MessageMediaLookupsClient($basicAuthUserName, $basicAuthPassword); $lookups = $client->getLookups(); $phoneNumber = 'YOUR_MOBILE_NUMBER'; $options = 'carrier,type'; $result = $lookups->getLookupAPhoneNumber($phoneNumber, $options); print_r($result); ?>
๐ API Reference Documentation
Check out the full API documentation for more detailed information.
๐ Need help?
Please contact developer support at developers@messagemedia.com or check out the developer portal at developers.messagemedia.com
๐ License
Apache License. See the LICENSE file.