Skip to content

Latest commit

 

History

History
113 lines (85 loc) · 3.68 KB

API.md

File metadata and controls

113 lines (85 loc) · 3.68 KB

API

This documents publicly available api endpoints, please explore core.views and core.urls to find more
  1. Login and get token
    POST - https://ddw.devinit.org/api/auth/login/
    Request Body:
    { 'username': [USER_NAME] 'password': [USER_PASSWORD] }
    Response: { "expiry": "2020-05-21T19:44:52.855584Z", "token": "444e8557ae50b6513490ca73c970af8d87e089ade581ed30a4ae654c16928d7a", "user": { "id": 1, "username": ...., "tag_set": [], "operation_set": [], "review_set": [], "is_superuser": true, "user_permissions": [] } }
    PS:
    - Login is not required anymore for read only endpoints;
    - To access write endpoints include authorization header
    (Authorization: Token 557ae50b6513490ca73c970af8d87e089ade581ed30a4ae654c16928d7a)

  2. Fetch scheduled events
    GET - https://ddw.devinit.org/api/scheduled_event/
    Headers:
    Content-Type: application/json

  3. Fetch scheduled event run instances (history) - takes in the scheduled event ID
    GET - https://ddw.devinit.org/api/scheduled_event/[EVENT_ID]/run_instances/
    Headers:
    Content-Type: application/json

  4. List all update scripts
    GET - https://ddw.devinit.org/api/list_update_scripts/

  5. Download csv file for selected operation id;
    GET - https://ddw.devinit.org/api/export/[OPERATION_ID]/

  6. Return result of query operation id;
    GET - https://ddw.devinit.org/api/dataset/data/[OPERATION_ID]/

  7. Return list of published datasets;
    GET - https://ddw.devinit.org/api/datasets/

  8. Return list of both draft and published datasets;
    GET - https://ddw.devinit.org/api/datasets/mine/

  9. Return details of selected dataset;
    GET - https://ddw.devinit.org/api/dataset/[DATASET_ID]/

  10. Return list of sources;
    GET - https://ddw.devinit.org/api/sources/

  11. Return details of source selected by id;
    GET - https://ddw.devinit.org/api/sources/[SOURCE_ID]/

  12. Return list of Frozen Data
    GET - https://ddw.devinit.org/api/frozendata/ returns listing of frozen data

  13. Create new frozen data
    POST - https://ddw.devinit.org/api/frozendata/

    Request Body:

    {
      "parent_db_table":"[TABLE_NAME]",
      "completed":"p", // options include p (pending), r (running), c (completed), e (errored)
      "active":true,
      "comment": ""
    }
    
  14. Details of Frozen Data selected by ID
    GET - https://ddw.devinit.org/api/frozendata/[FROZENDATA_ID]/ returns details of frozen data

  15. Delete frozen data DELETE - https://ddw.devinit.org/api/frozendata/[FROZENDATA_ID]/

  16. Return list of Saved Query Data
    GET - https://ddw.devinit.org/api/savedquerysets/ returns listing of Saved Query Data

  17. Create new saved query data POST - https://ddw.devinit.org/api/savedquerysets/

    Request Body:

    {
      "operation":"[OPERATION_ID]",
      "completed":"p", // options include p (pending), r (running), c (completed), e (errored)
      "active":true,
      "comment": ""
    }
    
  18. Details of Saved Query Data selected by ID
    GET - https://ddw.devinit.org/api/savedqueryset/[SAVEDQUERYDATA_ID]/ returns details of saved query data

  19. Delete saved query data DELETE - https://ddw.devinit.org/api/savedqueryset/[SAVEDQUERYDATA_ID]/

  20. Download Frozen Data
    GET - https://ddw.devinit.org/api/tables/download/[FROZEN_TABLE_NAME]/archives/

  21. Download Saved Query Set Data
    GET - https://ddw.devinit.org/api/tables/download/[QUERY_SET_DB_TABLE]/dataset/