Skip to content

Custom Search - Update Schema API

Introduction

This API allows the developer to update an already registered data representation schema associated with their project for Custom search database. The data representation schema is used by the search engine to configure and index the added records so that intended filters and search criteria can be applied on the added records by the consuming solution.

URL

https://search.mappls.com/search/byod/schema

HTTPS Method

PUT

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.

  1. Copy and paste the key from your credentials section from your API keys into the access_token query 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

  1. 201: To denote a successful data created.

Client-Side Issues

  1. 400: Bad Request, User made an error while creating a valid request.
  2. 401: Unauthorized, Developer’s key is not allowed to send a request.
  3. 403: Forbidden, Developer’s key has hit its daily/hourly limit.
  4. 409: Conflict.

Server-Side Issues

  1. 500: Internal Server Error, the request caused an error in our systems.
  2. 503: Service Unavailable, during our maintenance break or server downtimes.

Response Messages

  1. 201: Created.
  2. 204: No matches we’re found for the provided query.
  3. 400: Something’s just not right with the request.
  4. 401: Access Denied.
  5. 403: Forbidden, Services for this key has been suspended due to daily/hourly transactions limit.
  6. 409: Conflict.
  7. 500: Something went wrong.
  8. 503: Maintenance Break.

Request Parameters

Mandatory Parameters

  1. searchFields (object): list of attributes of records as key value pairs where values are in boolean. This list of attributes are the ones on which textual search will be active and they will be accordinly indexed. Example: "facilityName": true
  2. filterFields (object): list of attributes of records as key value pairs where describe the type of filtering active on the respective attribute. This list of attributes are the ones on which nearby search with custom filtering criteria will be active and they will be accordinly indexed. Example: "ownership": "exact" Types of accepted filter values are below in annexure table 2.
  3. extendedFields (object): A list of all the custom attributes of a record that are maintained in the project's schema. This list of extended attributes are the ones on which either textual search or nearby search with filters will be active. Example:
    "ownership": {
                    "dataType": "text"
                }
- `dataType` (string): data types of different custom attributes that are acceptable. Valid values are listed in annexure table 1 below.

Optional Parameters

  1. isCustomSearch (boolean): Used to enable or disable custom textual search on custom fields defined in extendedFields above.
  2. isCustomFilter (boolean): Used to enable or disable filter based nearby search on custom fields defined in extendedFields above.

Response Parameters

None

Sample cURL Request

Sample 1

curl --location --request PUT 'https://search.mappls.com/search/byod/schema?access_token=hklmgbwzrxncdyavtsuojqpiefrbhqplnm' \
--header 'Content-Type: application/json' \
--data-raw '{
    "extendedFields": 
    {},
    "searchFields":
    {
        "facilityName": true,
        "district": true
    },
    "filterFields":
    {
        "ownership": "exact",
        "medicineSystem": "logical",
        "specialities": "logical",
        "state": "logical",
        "district": "logical"

    },
    "isCustomSearch": true,
    "isCustomFilter": true
}'

Sample Response

{
    "message": "UPDATED",
    "responseCode": 200
}

Appendix Table 1

Serial dataType Description
1 text Supports textual data.
2 double This datatype allows only fractional numbers.
3 long The data type can store whole numbers from -9223372036854775808 to 9223372036854775807
4 integer The data type can store whole numbers from -2147483648 to 2147483647
5 boolean Support Boolean values true or false

Appendix Table 2

Serial Filter Name Filter Operation Supported dateTypes Description
1 exact : text, integer, long, double, boolean This is used for full text search queries.
2 range -le, -ge, -lt, -gt, -bt Integer, long, double Is used with comparison operators
3 logical ;(or), $(and) text, integer, long, double, boolean Is used to combine two filter criteria.

For any queries and support, please contact:

Email us at apisupport@mappls.com

Support Need support? contact us!



@ Copyright 2025 CE Info Systems Ltd. All Rights Reserved.