Custom Search - Add Record API¶
Introduction¶
This API allows one to dynamically add record to the Custom search database. These records are used to perform Nearby Searches on the different types of user records that are stored within custom search database. Add/insert the location based information and entities according to your module and requirements to create Nearby search for it.
URL¶
https://search.mappls.com/search/byod/add-record
HTTPS Method¶
POST
Getting Access¶
Before using the API in the your solution, please ensure that the related access is enabled in the Mappls Console, within your app - be it for Mobile OR Web or Cloud integration.
- Copy and paste the key from your
credentialssection from your API keys into theaccess_tokenquery parameter.- Your static key can be secured by whitelisting its usage for particular IPs (in case of cloud app usage) OR a set of domains (in case of a web app)
- Your static key obtained from your Console is to be passed as a query parameter:
access_token.
Authentication Object - access_token mandatory query parameter.¶
access_token: "hklmgbwzrxncdyavtsuojqpiefrbhqplnm".
Response Type¶
application/json
Response Codes¶
Success¶
- 201: To denote a successful data created.
Client-Side Issues¶
- 400: Bad Request, User made an error while creating a valid request.
- 401: Unauthorized, Developer’s key is not allowed to send a request.
- 403: Forbidden, Developer’s key has hit its daily/hourly limit.
- 409: Conflict.
Server-Side Issues¶
- 500: Internal Server Error, the request caused an error in our systems.
- 503: Service Unavailable, during our maintenance break or server downtimes.
Response Messages¶
- 201: Created.
- 204: No matches we’re found for the provided query.
- 400: Something’s just not right with the request.
- 401: Access Denied.
- 403: Forbidden, Services for this key has been suspended due to daily/hourly transactions limit.
- 409: Conflict.
- 500: Something went wrong.
- 503: Maintenance Break.
Request Parameters¶
The “bold” one’s are mandatory, and the “italic” one’s are optional.
Mandatory Parameters¶
recordId (string): Unique identifier of the record from the client.recordType (string): The category of the record; referenced from a defined set of category codes by the client.recordEloc (string): Eloc of the places.recordCoordinates (string): Latitude & Longitude of the record. E.g. "28.670023825198,77.22407913572087".
Note: Either recordEloc or recordCoordinates is required.
Optional Parameters¶
customNote (string): The custom note or description to the record.isExpired (boolean): Set to be true if record is expired; default set to false.extendedInfo (object): With this parameter client can add n number of information.
Sample cURL Request¶
Sample 1¶
Record added with geographical coordinate values.
curl --location 'https://search.mappls.com/search/byod/add-record?access_token=hklmgbwzrxncdyavtsuojqpiefrbhqplnm' \
--header 'Content-Type: application/json' \
--data-raw '{
"recordId": "1001",
"recordType": "WFHORWFO",
"recordCoordinates": "28.50833, 77.33518",
"extendedInfo": {
"organization": "CE Infosystems",
"address": "237 okhla",
"team": "API Support",
"location": "Home",
"WFH": "N",
"id type": "mobile number"
}
}'
Sample 2¶
Record added with eloc value.
curl --location 'https://search.mappls.com/search/byod/add-record?access_token=hklmgbwzrxncdyavtsuojqpiefrbhqplnm' \
--header 'Content-Type: application/json' \
--data-raw '{
"recordId": "1002",
"recordType": "WFHORWFO",
"recordEloc": "U8KZB2",
"extendedInfo": {
"organization": "CE Infosystems",
"address": "237 okhla",
"team": "API Support",
"location": "Home",
"WFH": "N",
"id type": "mobile number"
}
}'
Sample Response¶
{
"message": "CREATED",
"responseCode": 201
}
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!
