Lookup request
Send single request
POST
https://a.looplookup.com/api/v1/lookup/
This endpoint allows you to submit your message to the sending queue. When a message in the queue will be ready to send in iMessage, an attempt will be made to deliver it to the recipient.
Headers
Authorization*
String
API Key
Content-Type*
String
application/json
Request Body
contact*
String
Phone number or Email.
region
String
Value in ISO-2 country code. For example: US
, GB
, CA
AU
, etc.
This parameter should be passed only if you passed a phone number to contact
without a country code.
contact_details
Bool
Callback/Webhook will contain additional information related to the phone number. For example: carrier name, number type (landline or mobile), country, timezone and etc. Requests with this parameter may take a little bit more time.
{
"request_id": "2BC4FD6A-CE49-439F-81DF-E895C09CA49C",
"success": true,
"contact": "+13231112233",
}
A phone number will be converted to the next format +13231112233
, without spaces and brackets. An email will be converted into a lowercase format.
Important
When you receive success response with code 200 from send request, it means that the server accepted your request for lookup and added it to the queue.
To handle lookup results for your requests, need to observe Callbacks or use API method to check the status by request ID which you received in JSON response.
We recommend using callbacks to track statuses, as you will receive a response as soon as the results are ready.
Send bulk lookup
POST
https://a.looplookup.com/api/v1/lookup/
Headers
Authorization*
String
API Key
Content-Type*
String
application/json
Request Body
contacts*
Array
An array of contacts. Should contains phone numbers in international formats or emails. Example: ["+13231112233", "[email protected]", “1(787)111-22-33”].
Invalid recipients will be skipped.
contact_details
bool
Callback/Webhook will contain additional information related to the phone number. For example: carrier name, number type (landline or mobile), country, timezone and etc. Requests with this parameter may take a little bit more time.
region
String
Value in ISO-2 country code. For example: US
, GB
, CA
AU
, etc.
This parameter should be passed only if you passed phone numbers without a country code.
{
"success": true,
"requests": [
{
"contact": "+13231112233",
"request_id": "2BC4FD6A-CE49-439F-81DF-E895C09CA49C"
}
]
}
A phone number will be converted to the next format +13231112233
, without spaces and brackets. An email will be converted into a lowercase format.
Cancel bulk request
Request to cancel bulk lookup
DELETE
https://a.looplookup.com/api/v1/bulk-lookup/delete/{id}/
Path Parameters
id*
String
Bulk request ID
Headers
Authorization*
String
API Key
Content-Type*
String
application/json
{
"success": true,
"requests": [
{
"contact": "+13231112233",
"request_id": "2BC4FD6A-CE49-439F-81DF-E895C09CA49C"
}
]
}
A phone number will be converted to the next format +13231112233
, without spaces and brackets. An email will be converted into a lowercase format.
Failed requests
If your request has a failed status, you will receive a JSON response with the following format:
{
"success": false,
"code": 100,
"message": "string"
}
Error codes
Bad request
Missing credentials in request
One or more required parameters for the request are missing
Authorization key is invalid or does not exist
Secret key is invalid or does not exist
No "recipient" parameter in request
Invalid recipient
Invalid recipient email
Invalid recipient phone number
A phone number is not mobile
No available requests/credits on your balance
Your account is suspended
Your account is blocked
Your account is suspended due to debt
Best Practices
Performance
Since the lookup process is asynchronous, each request will be collected in the lookup queue. Due to the lookup queue having a limited resource for lookups per second*, the queue will determine the priority for each request based on the type of your request and the volume of requests you have sent.
A single request is good if you need to lookup one contact at a random time. Because it's has a high priority to start lookup immediately. But it is slow if you need to process large volumes in a short time. The queue for a single lookup goes according to the FIFO rules. This means that every time you send a request, you add a new operation to the queue. The duration for each operation could take a few seconds. So, if you send 100 single lookup requests simultaneously, the last operation can be finished after a delay of 100-400 seconds.
If you need to lookup a large list of contacts, it's highly recommended to use the bulk API request only.
In this case, the lookup queue can calculate the resources that will be needed for your volume and process them as soon as possible. If you have a list of about ~10 thousand contacts, try to send them as bulk requests in batches of 2-3 thousand contacts in each request. Don't send such large volumes as single requests, it will always take longer since they will always be scheduled according to the FIFO rules.
Last updated