Skip to content

API reference

LBS API

LBS API allows the developer to request a location of a subscriber. Upon the request, mSpace will communicate the location of the subscriber if he/she has granted the permission.

Base URL
https://api.mspace.lk
Content type
application/json;charset=utf-8
Endpoints
1
POSTlbs/request

Request Location

https://api.mspace.lk/lbs/request

This service is used by the developer to request a location of a subscriber. Upon the request, mSpace will communicate the location of the subscriber if he/she has granted the permission.

Request bodyapplication/json;charset=utf-8

applicationId
stringRequired

Application identification within the platform

Example:APP_001768
password
stringRequired

Password of the application

Example:729fdf8ea178cdea9857eeb9a059fd6e
version
stringOptional

API version

Example:2.0
requesterId
stringRequired

MSISDN of the subscriber who is requesting the location updates. This is a unique identifier. Note: MSISDN might be a masked number depending on the type of the application

Example:tel:94711275563
subscriberId
stringRequired

MSISDN of the subscriber whose location is needed. This is a unique identifier. Note: MSISDN might be a masked number depending on the type of the application

Example:tel:94711275563
serviceType
ENUMOptional

Required MLP service type. Currently supports: IMMEDIATE

Example:IMMEDIATE
Request sampleJSON
{
  "applicationId": "APP_001768",
  "password": "729fdf8ea178cdea9857eeb9a059fd6e",
  "version": "2.0",
  "requesterId": "tel:94711275563",
  "subscriberId": "tel:94711275563",
  "serviceType": "IMMEDIATE"
}

Response200 successapplication/json;charset=utf-8

version
stringRequired

API version

Example:1.0
messageID
stringOptional

MessageID to uniquely Identify the request within the SDP

Example:101304051248020083
latitude
stringOptional

Latitude coordinate of the location of the subscriber

Example:38.8951
longitude
stringOptional

Longitude coordinate of the location of the subscriber

Example:-77.0364
subscriberState
BooleanOptional

Power on/off state of the target subscriber's mobile phone. True: power on, False: power off

Example:false
timestamp
stringOptional

System date and time of success or failed transaction

Example:2022-01-20'T'13:20:10
statusCode
stringRequired

The error code for the request

Example:E1303
statusDetail
stringRequired

The error detail for the request

Example:IP address, which the request originates from, is not listed within the allowed-host-address list
Response sample200 · JSON
{
  "version": "1.0",
  "messageID": "101304051248020083",
  "latitude": "38.8951",
  "longitude": "-77.0364",
  "subscriberState": "false",
  "timestamp": "2022-01-20'T'13:20:10",
  "statusCode": "E1303",
  "statusDetail": "IP address, which the request originates from, is not listed within the allowed-host-address list"
}

Code samples (Java, PHP, javaScript, .net): coming soon