Category Retrieval by ID, ATC Code, or MeSH ID


Endpoint Overview

This API endpoint allows for the retrieval of medication category information based on a unique identifier, which can be a category ID, an ATC (Anatomical Therapeutic Chemical) code, or a MeSH (Medical Subject Headings) ID.


Endpoint Details

DescriptionDetails
URLhttps://www.britelink.io/api/v1/categories/{codeId}
MethodGET
AuthorizationBearer Token (if required)

URL Parameter

ParameterDescriptionExample
codeIdA unique identifier that can be a category ID, ATC code, or MeSH ID.clqjkjarq000049khgvkwz6gf, N02BA, MESH12345

Request Headers

HeaderValueDescription
Content-Typeapplication/jsonIndicates the media type of the resource
AuthorizationBearer <API_KEY>API key for access (if authentication is required)

Example Requests

  1. Fetch by Category ID:
    https://www.britelink.io/api/v1/categories/clqjkjarq000049khgvkwz6gf

  2. Fetch by ATC Code:
    https://www.britelink.io/api/v1/categories/atc/N02BA

  3. Fetch by MeSH ID:
    https://www.britelink.io/api/v1/categories/mesh/MESH12345


Expected Responses

  • Success Response:

    • Code: 200 OK
    • Content: JSON object with category details.
  • Error Response:

    • Code: 404 Not Found
    • Content: {"message": "No category found with the provided code"}

Response Structure

{
  "id": "string",
  "name": "string",
  "meshId": "string",
  "atcCode": "string",
  ...
  "drugs": [
    ...
  ]
}

Implementation Notes

  • Ensure that the API correctly differentiates between Category ID, ATC code, or MeSH ID.
  • Implement robust error handling for non-existent identifiers.
  • Include authentication mechanisms where necessary.
  • The endpoint should be designed to handle high-traffic scenarios with efficient database queries.

Versioning

  • Documentation Version: 1.1
  • Last Updated: [Insert Date]