Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] API - Add Code list #159

Open
janbur opened this issue Nov 29, 2023 · 1 comment
Open

[Feature Request] API - Add Code list #159

janbur opened this issue Nov 29, 2023 · 1 comment
Labels
Back-end 🕓 3 - 4 hours It will take me between 2 hours to half a day.

Comments

@janbur
Copy link
Collaborator

janbur commented Nov 29, 2023

This is the child of: #151

Current API docs: https://geosight.unicef.org/api/v1/docs/

Objective

Create a new API endpoint for adding a new Code Lists to GeoSight. This will support batch import of code lists and syncing code lists from other platforms (e.g. UNICEF SDMX Data Warehouse: https://sdmx.data.unicef.org/overview.html.
Check sample code lists from SDMX Data Warehouse: https://sdmx.data.unicef.org/items/codelist.html

Implementation

POST /api/v1/code-list/

  • 📒 Description:

    • Create an code list.
  • ⬇️ Payloads:

    • name
    • description
    • codes {Array}
      • id
      • name
      • value
  • ⬆️ Returns:

    • 201:
      • name
      • description
      • codes {Array}:
        • id
        • name
        • value
    • 400:
      • response error

PUT /api/v1/code-list/{id}

  • 📒 Description:
    • Update an code list
  • ⬇️ Payloads:
    • id
    • name
    • description
    • codes {Array}: {Optional, when empty, it will not replace the codes. If not empty, replace codes.}
      • id
      • name
      • value
  • ⬆️ Returns:
    • 200:
      • id
      • name
      • description
      • codes {Array}:
        • id
        • name
        • value
@janbur janbur changed the title [Feature Request] API - Add new Code list [Feature Request] API - Add Code list Nov 29, 2023
@meomancer
Copy link
Collaborator

meomancer commented Nov 30, 2023

This is partial of #158
Technical :

Example code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back-end 🕓 3 - 4 hours It will take me between 2 hours to half a day.
Projects
None yet
Development

No branches or pull requests

2 participants