Project

General

Profile

Task #1900

API: Adding attributes in JSON Response

Added by Kurt Gerber over 5 years ago. Updated almost 5 years ago.

Status:
In Progress
Priority:
High
Category:
Dev Task
Start date:
17 Dec 2019
Due date:
% Done:

0%

Estimated time:
Resolution:
fixed

Description

The API endpoint

.../api/v2/questionnaires/

responds with a list of cases (technologies/approaches).

for each case it lists the following attributes:

"results": [
        {
            "name": "Community-based Natural Resource Management",
            "updated": "2017-08-23T15:00:47.172403+02:00",
            "code": "approaches_2542",
            "edition": "2015",
            "url": "/en/wocat/approaches/view/approaches_2542/",
            "translations": [
                [
                    "en",
                    "English" 
                ]
            ],
            "details": "/en/api/v2/questionnaires/approaches_2542/" 
        },
   ...
Different metadata attributes should be added to this output, which are not available in the detail neither:
  • created : <TIMESTAMP> - timestamp, on which the case was created/added
  • compiler: <Name> - The compiler, e.g. author, of the case
  • reviewer: [<Name>,<Name>,...] - list of reviewers of this case

All those attributes are visible in the web interface on the detail page of a technology or approach. But all those informations are missing in the API.

So the JSON response should look like (example from above):

"results": [
        {
            "name": "Community-based Natural Resource Management",
            "created":"2016-09-02 23:59:59+02:00",
            "updated": "2017-08-23T15:00:47.172403+02:00",
             "compiler":"Aqila Haidery" 
             "reviewer":["Deborah Niggli"]
            "code": "approaches_2542",
            "edition": "2015",
            "url": "/en/wocat/approaches/view/approaches_2542/",
            "translations": [
                [
                    "en",
                    "English" 
                ]
            ],
            "details": "/en/api/v2/questionnaires/approaches_2542/" 
        },
   ...

Files

tests_log_09Apr20.log (102 KB) tests_log_09Apr20.log Brahadeesh Dheenadayalan_Sivakami, 09 Apr 2020 21:52

Also available in: Atom PDF