Data Soap
> BATCH API

Batch API

Upload a list of lookups in JSON format and get back a job ID - check its status and pull the results once processing finishes.

Back to API list
BASE · https://api2.datasoap.co.uk

Introduction

The Batch API is a synchronous API with multiple endpoints tied directly to Data Soap's backend batch system. Upload a list of lookups in JSON format and you'll get back a unique job ID, which you then use to check status and retrieve results.

Considerations

  • Treat your account details and credentials as secret - you are responsible for every request submitted.
  • Every submission to the system is audited for management and security purposes.
  • Submitting duplicate lookups bills your account for each individual submission.

Getting started

Set up an API password from your account's profile section - by default, API access is denied until a password is set. Make sure you have credits for the services you want to run; if not, purchase them from the bundles page.

All requests go to api2.datasoap.co.uk over SSL (port 443). The endpoint only supports POST requests. Credentials are passed via HTTP Basic Auth - email and password delimited with a colon.

Header
Authorization: Basic user@datasoap.com:Ap!T3st123

Base64-encoded credentials are also accepted:

Header (base64)
Authorization: Basic dXNlckBNb2JpbGVWZXJpZmljYXRpb24uY29tOkFwIVQzc3QxMjM=

Start a batch

POST/v1/batch

Start a new batch of lookups. Provide the list of lookups and the request type (e.g. TPS, HLR) - this is the first step in the process.

Request
{
"Lookups": ["07916872100"],
"Type": "tps",
"Name": "batch api test"
}
Response
{ "JobId": 18930 }

Keep hold of the returned JobId - you'll need it for every request after this one.

Get a job

GET/v1/batch/job/{jobId}

Gets the result of a job, or its current status if it isn't finished yet. While pending or processing, a progress field shows the current state; once finished, a results field lists each lookup with its result.

Pending
{
"JobId": 18930,
"Name": "batch api test",
"Type": "Tps",
"Status": "Processing",
"Progress": { "Progress": 42.71, "State": "Performing TPS" },
"Started": "2018-10-18T14:32:07.057"
}
Complete - TPS
{
"JobId": 18930,
"Name": "batch api test",
"Type": "Tps",
"Status": "Complete",
"Results": [{ "Lookup": "07916872100", "Result": { "Msisdn": "0447916872100", "Tps": true, "Ctps": false, "Dnc": false } }],
"Started": "2018-10-18T10:25:40.747",
"Finished": "2018-10-18T10:25:41.34"
}
Complete - HLR
{
"JobId": 18930,
"Name": "batch api test",
"Type": "Hlr",
"Status": "Complete",
"Results": [{ "Lookup": "07916872100", "Result": { "Msisdn": "0447916872100", "Mcc": 234, "Mnc": "30", "CountryName": "United Kingdom of Great Britain and Northern Ireland", "NetworkName": "UK - Everything Everywhere Limited (TM)", "On": true } }],
"Started": "2018-10-18T10:25:40.747",
"Finished": "2018-10-18T10:25:41.34"
}
Complete - Landline
{
"JobId": 18930,
"Name": "batch api test",
"Type": "Landline",
"Status": "Complete",
"Results": [{ "Lookup": "07916872100", "Result": { "IsActive": true, "Msisdn": "0447916872100" } }],
"Started": "2018-10-18T10:25:40.747",
"Finished": "2018-10-18T10:25:41.34"
}

List jobs

GET/v1/batch/jobs

A list of all recent jobs, processed or processing - handy if a job ID gets lost, or for a general overview.

Response
[
{
"JobId": 31105,
"Name": "batch api test",
"Type": "Landline",
"Status": "Finished",
"Finished": "2018-10-18T14:36:29.637",
"Progress": { "Progress": 0, "State": "Pending" },
"Started": "2018-10-18T14:36:29.013"
},
{
"JobId": 31104,
"Name": "batch api test2",
"Type": "Hlr",
"Status": "Finished",
"Finished": "2018-10-18T14:35:00.15",
"Progress": { "Progress": 100, "State": "Finished" },
"Started": "2018-10-18T14:34:59.153"
}
]

Trusted at scale

The same infrastructure behind every endpoint on this page, in production today.

0B+
Numbers validated
0K+
Batch cleans
0ms
p50 latency
0%
Uptime