馃摍
Sunbird Lern
AskDot
  • LEARN
    • Overview
    • Functional Capabilities
    • Technical Architecture
      • Technical Architecture Diagram
      • Tech Stack
    • Dependencies
    • Product Roadmap
  • USE
    • Overview
    • Release Notes
      • Release V 8.0.0 (Ongoing)
      • Release V 7.0.0
      • Release V 5.4.0
      • Release V 5.3.0
      • Release V 5.2.0
      • Release V 5.1.0
      • Release V 5.0.1
      • Release V 5.0.0
      • Release V 4.10.0
      • Release V 4.9.0
      • Release V 4.8.0
      • Release V 4.7.0
    • Developer Guide
      • USER & ORG SERVICE
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Keycloak Local setup
          • Additional Installation Dependencies:
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
              • User
              • Organisation
              • System Settings
              • Role
              • Bulk Upload Process
              • Tenant Preference
              • Cassandra Migration Version
              • User Consent
              • Email Template
              • OTP
              • Page Management (LMS Service)
              • Location
              • User Notes
              • Deprecated
          • Elastic Search
          • Redis
        • APIs
          • User Management
            • User Deletion API
            • Ownership Transfer API
          • Organisation Management
          • Location Management
          • Consent Management
          • OTP Services
          • Tenant Configurations
          • Bulk Upload
          • System Settings
          • API Management Service
          • Data Sync
          • Notification APIs
        • Flink Jobs
          • User Cache Updater
          • User Deletion Cleanup Flink Job
          • Ownership Transfer Flink Job
        • Reports
          • Standard Exhaust
            • State Admin Geo report
            • State Admin Report
          • Other Jobs
            • User Cache Indexer Job
            • Delete Users Assets Report
          • Data Products Developer Installation
            • System Requirements
            • Tech Stack
            • Installation Dependencies
            • Local installation of data-products
            • Server setup Guide
            • Installation Configuration
            • Data-product creation guide
            • Troubleshooting a data-product
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
          • System Settings
          • Email Configuration
          • SMS Configuration
          • OTP based SMS Configuration
        • Roles
          • System Roles
          • User Roles
          • RBAC
        • Dependencies
        • Keycloak on Sunbird
        • How to Guide
          • Create Organization
          • Create User
          • Add new user type & location
        • Single Sign-on with Sunbird
        • Caching and Denormalising User Metadata
          • ETLUserCacheUpdaterJob
          • UserCacheUpdaterFlinkJob
        • Unit Tests and Code Coverage
        • FAQs
      • LMS(BATCH) SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
        • Data Models
          • Cassandra
            • Data Dictionary
          • ElasticSearch
          • Redis
        • APIs
        • Flink Jobs
          • Merge User Courses
          • Relation Cache Updater
          • Activity Aggregate Updater
          • Assessment Aggregator
          • Enrolment Reconciliation
          • Collection Certificate Pre-Processor
          • Collection Certificate Generator
        • Reports
          • On-Demand Exhaust
            • Response Exhaust
            • User Info Exhaust
            • Progress Exhaust
          • Other Jobs
            • Collection Summary Job
            • Course Batch Status Updater Job
            • Cassandra Migrator Job
            • Score Metric Migration Job
            • Assessment Score Correction Job
            • Collection Reconciliation Job
            • Course Enrollment Job
            • Course Consumption Job
        • Logs, Telemetry Events
        • Configuration
          • System Configuration
          • Functional Configuration
        • Dependencies
        • Certificate Registry and Credentialing using Sunbird-RC
          • Configuring PublicKey in Sunbird-RC
          • Server Setup guide for Sunbird-RC
          • API Guide For Sunbird-RC
        • Certificate Flow
          • Certificates Creation and Configuration
        • FAQs
      • GROUPS
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
          • Redis
        • APIs
          • Create Group
        • Logs, Telemetry Events
          • UI Telemetry Events
          • Service Telemetry Events
        • Configuration
          • Functional Configurations
        • Design References
        • Dependencies
        • Unit Tests and Code Coverage
      • NOTIFICATION SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Data Dictionary
        • APIs
        • Flink Jobs
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
        • Dependencies
        • Unit Tests and Code Coverage
      • DISCUSSION FORUM
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
            • Nodebb setup
            • Discussion Middleware Setup
            • Discussion Middleware
            • Discussion forum integration with any application
            • Discussion-UI setup along with demo application.
            • Sunbird-lern portal for DF
          • Source Code
        • APIs
          • Category APIs
          • User APIs
          • Post APIs
          • Topic APIs
          • Forum APIs
        • Context Schema
        • Configurations
          • Nodebb Admin panel settings
          • Discussion MW & Nodebb System Config
        • Telemetry Events
        • Dependencies
      • ML SERVICE
        • DATA PIPELINE (Flink Jobs)
          • Program User Info
            • Component Diagram
            • Data Model
            • Folder Structure
          • Ml User Delete
            • Component Diagram
            • Data Model
            • Folder Structure
        • DATA PRODUCTS
          • Program Exhaust
            • Component Diagram
            • Folder Structure
    • Server Installation
    • Dependency setup
    • Deprecation
      • Release-5.4.0
    • Jenkins Jobs
    • Release Calendar
    • Learn More
      • Tech References
      • Telemetry Processing
      • Data Dictionary
        • Sample Data
      • Delete User Functionality
      • Asset Ownership Transfer
    • FAQs
  • Engage
    • Discuss
    • Contribute to Sunbird Lern
    • Raise an Issue
    • Contribution Guidelines
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. USE
  2. Developer Guide
  3. USER & ORG SERVICE
  4. APIs

Location Management

PreviousOrganisation ManagementNextConsent Management

Last updated 2 years ago

Was this helpful?

Delete-Location

delete

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.
Path parameters
locationIdstringRequired

Location id of location

Header parameters
AuthorizationstringRequired

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.

Example: {{authorization}}
Responses
200
SUCCESS. The **Delete location** operation was successful!
application/json
400
- Bad Request - RESOURCE NOT FOUND.**Delete location** operation failed !The possible reason for the failure is that requested resource could not be found
application/json
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'
application/json
delete
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"
  }
}
  • POSTCreate-Location
  • POSTSearch-Location
  • PATCHUpdate-Location
  • DELETEDelete-Location

Create-Location

post

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.
Header parameters
AuthorizationstringRequired

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.

Example: {{authorization}}
Body
Responses
200
SUCCESS. The **Create location** operation was successful!
application/json
400
BAD REQUEST,**Create location** operation failed !The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'
application/json
post
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"
  }
}

Search-Location

post

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.
Header parameters
AuthorizationstringRequired

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.

Example: {{authorization}}
Body
Responses
200
SUCCESS. The **Search location** operation was successful!
application/json
400
RESOURCE NOT FOUND.**Search Location ** operation failed !The possible reason for the failure is that requested resource could not be found
application/json
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'
application/json
post
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
  }
}

Update-Location

patch

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.
Header parameters
AuthorizationstringRequired

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.

Example: {{authorization}}
Body
Responses
200
SUCCESS. The **Update location** operation was successful!
application/json
400
RESOURCE NOT FOUND.**Update Location ** operation failed !The possible reason for the failure is that requested resource could not be found
application/json
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'
application/json
patch
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"
  }
}