Skip to content

API Locus

Alexandre P Francisco edited this page Jun 20, 2023 · 18 revisions

GET /taxa/{taxon}/loci

Description: Retrieves the specified page of loci

Request:

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

Success Response:

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

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: User

GET /taxa/{taxon}/loci/{locus}

Description: Retrieves the specified locus

Request:

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

Success Response:

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

Error Responses:

  • 404 Not Found
  • 401 Unauthorized

Role: User

PUT /taxa/{taxon}/loci/{locus}

Description: Stores the specified locus

Request:

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

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 400 Bad Request
  • 401 Unauthorized

Role: Admin

DELETE /taxa/{taxon}/loci/{locus}

Description: Deprecates the specified locus

Request:

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

Success Response:

  • Status Code: 204 No Content

Error Responses:

  • 401 Unauthorized

Role: Admin