Location Management
This API is used to create a physical location of a user or an organization, depending upon the usecase
- The endpoint for Create location is
/data/v1/location/create
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
To make use of any Location API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.
{{authorization}}
POST /api/data/v1/location/create HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{authorization}}
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"request": {
"code": "APCODE",
"name": "APSTATE1",
"type": "state"
}
}
{
"id": "api.location.create",
"ver": "v1",
"ts": "2020-11-20 07:09:36:098+0000",
"params": {
"resmsgid": null,
"msgid": "f794b084-d4e9-4ce3-9795-82c88ada6b66",
"err": null,
"status": "success",
"errmsg": null
},
"responseCode": "OK",
"result": {
"response": "SUCCESS",
"id": "6824e3d3-5512-4344-a481-7bac011edaa8"
}
}
This API is associated with fetching the location data based on the criterias specified in the request body.
- The endpoint for Search location is
/data/v1/location/search
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
To make use of any Location API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.
{{authorization}}
POST /api/data/v1/location/search HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{authorization}}
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"request": {
"filters": {
"code": "APCODE1"
}
}
}
{
"id": "api.location.search",
"ver": "v1",
"ts": "2020-11-20 07:20:43:770+0000",
"params": {
"resmsgid": null,
"msgid": "2d12c998-96c4-43d6-8937-4ebbb8b68d02",
"err": null,
"status": "success",
"errmsg": null
},
"responseCode": "OK",
"result": {
"response": [
{
"identifier": "6824e3d3-5512-4344-a481-7bac011edaa8",
"code": "APCODE",
"name": "APSTATE",
"id": "6824e3d3-5512-4344-a481-7bac011edaa8",
"type": "state"
}
],
"count": 1
}
}
This API is associated with updating the location data based on the location id,
- The endpoint for Update location is
/data/v1/location/update
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
To make use of any Location API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.
{{authorization}}
PATCH /api/data/v1/location/update HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{authorization}}
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"request": {
"name": "APSTATE1",
"id": "e4e60956-277c-439e-bbf7-5c99730341f3"
}
}
{
"id": "api.location.update",
"ver": "v1",
"ts": "2020-11-20 12:58:11:871+0000",
"params": {
"resmsgid": null,
"msgid": "9e447000-03f7-43ee-9e3e-342c4a6d5acf",
"err": null,
"status": "success",
"errmsg": null
},
"responseCode": "OK",
"result": {
"response": "SUCCESS"
}
}
This API is associated with deleting the location data based on the location id.
- The endpoint for Search location is
/data/v1/location/delete
- The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Location id of location
To make use of any Location API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.
{{authorization}}
DELETE /api/data/v1/location/delete/{locationId} HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{authorization}}
Accept: */*
{
"id": "api.location.delete",
"ver": "v1",
"ts": "2020-11-20 13:17:44:741+0000",
"params": {
"resmsgid": null,
"msgid": "c549ef41-faa8-4db2-9136-3490a6ee2607",
"err": null,
"status": "success",
"errmsg": null
},
"responseCode": "OK",
"result": {
"response": "SUCCESS"
}
}
Last updated
Was this helpful?