Risks

Overview

This endpoint retrieves a list of risk factors associated with medications from the database. This endpoint is particularly useful for applications in healthcare and pharmaceutical sectors, providing critical information about potential risks related to drug usage.

Authentication

To access the endpoint, use the Authorization: Bearer YOUR_API_KEY header. Replace YOUR_API_KEY with your actual API key.

HTTP Request

GET https://www.britelink.io/api/v1/risks

Query Parameters

ParameterDescriptionRequiredType
nComma-separated list of risk factor names to filter by.NoString
rSet to true to include related boxed warnings in the response.NoBoolean
cursorCursor for pagination. Use the nextCursor from a previous response to fetch the next batch of results.NoString

Pagination

This endpoint supports cursor-based pagination and returns up to 25 risk factors per request. Use the cursor parameter with the nextCursor value from a previous response to navigate through more records.

Responses

  • HTTP 200: Successful response with a list of risk factors.
  • HTTP 404: No risk factors found for the given filters.
  • HTTP 500: Server error due to internal issues.

Sample Response

{
  "riskFactors": [
    {
      "id": "clr7vaaxr000s49i1g5swrqla",
      "name": "Increased Blood Pressure",
      // Other risk factor details
      "boxedWarnings": [] // List of boxed warnings if 'r' is true
    }
    // Additional risk factors
  ],
  "nextCursor": "ENCODED_CURSOR_STRING"
}

Notes

  • Ensure that the API key is provided in the request header for authorization.
  • If the r parameter is set to true, the response includes detailed boxed warnings associated with each risk factor.
  • If there are more risk factors than the batch limit, the nextCursor provides the starting point for the next set of data.
  • The response format adheres strictly to the JSON standard.

Error Handling

  • The endpoint is designed to handle and report errors effectively. In case of a server error, a 500 status code is returned with an appropriate message.
  • If no matching risk factors are found, a 404 status code is returned, indicating the absence of data based on the applied filters.