Skip to content

API Taxa

Alexandre P Francisco edited this page Jun 20, 2023 · 1 revision

GET /taxa

Description: Retrieves the specified page of taxa

Request:

  • Query String:
    • page (Integer, Optional) Page to retrieve. Default value is 0
  • Example:
curl --location --request GET 'http://localhost:8080/taxa?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: A list of objects with the resumed information of the taxa
  • Content Type:
    • application/json
  • Schema:
[
   {
      "id": String
      "version": Integer
   },
   ...
]
  • Example:
[{"id": "bbacilliformis", "version": 1}, {"id": "spneumoniae", "version": 2}]

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

GET /taxa/{taxon}

Description: Retrieves the specified taxon

Request:

  • URI Params:
    • taxon (String) Taxon identifier
  • Query String:
    • version (Integer, Optional) Version of the taxon information. Default value is the current version
  • Example:
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 200 OK
  • Content: An object with the information of the taxon
  • Content Type:
    • application/json
  • Schema:
{
   "id": String
   "version": Integer
   "deprecated": Boolean
   "description": String
}
  • Example:
{
   "id": "bbacilliformis", 
   "version": 1,
   "deprecated": false,
   "description": "Example taxon"
}

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

PUT /taxa/{taxon}

Description: Stores the specified taxon

Request:

  • URI Params:
    • taxon (String) Taxon identifier
  • Content: An object with the information of the taxon
  • Content Type:
    • application/json
  • Schema:
{
   "id": String
   "description": String
}
  • Example:
curl --location --request PUT 'http://localhost:8080/taxa/bbacilliformis?provider=google'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {Access Token}'
--data-raw '{
   "id": "bbacilliformis",
   "description": "Example taxon"
}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: Admin

DELETE /taxa/{taxon}

Description: Deprecates the specified taxon

Request:

  • URI Params:
    • taxon (String) Taxon identifier
  • Example:
curl --location --request DELETE 'http://localhost:8080/taxa/bbacilliformis?provider=google'
--header 'Authorization: Bearer {Access Token}'

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: Admin