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
| Description | Details |
|---|---|
| URL | https://www.britelink.io/api/v1/categories/{codeId} |
| Method | GET |
| Authorization | Bearer Token (if required) |
URL Parameter
| Parameter | Description | Example |
|---|---|---|
codeId | A unique identifier that can be a category ID, ATC code, or MeSH ID. | clqjkjarq000049khgvkwz6gf, N02BA, MESH12345 |
Request Headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json | Indicates the media type of the resource |
Authorization | Bearer <API_KEY> | API key for access (if authentication is required) |
Example Requests
-
Fetch by Category ID:
https://www.britelink.io/api/v1/categories/clqjkjarq000049khgvkwz6gf -
Fetch by ATC Code:
https://www.britelink.io/api/v1/categories/atc/N02BA -
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.
- Code:
-
Error Response:
- Code:
404 Not Found - Content:
{"message": "No category found with the provided code"}
- 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]