EndpointsMedication Logs

Medication Logs

Function-calling namespace: medicationLogs

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

generateMedicationSchedule

Source: backend/endpoints/medication-logs/generate-medication-schedule

Input Fields

FieldTypeRequired
stackUserIdstringYes
prescriptionIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "generateMedicationSchedule",
  "data": {
    "stackUserId": "stackuser_123",
    "prescriptionId": "prescription_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getActivePrescriptionsWithTracking

Source: backend/endpoints/medication-logs/get-active-prescriptions-with-tracking

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getActivePrescriptionsWithTracking",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getAdherenceStats

Source: backend/endpoints/medication-logs/get-adherence-stats

Input Fields

FieldTypeRequired
stackUserIdstringYes
prescriptionIdstringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getAdherenceStats",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getMedicationHistory

Source: backend/endpoints/medication-logs/get-medication-history

Input Fields

FieldTypeRequired
stackUserIdstringYes
startDatestringNo
endDatestringNo
limitintNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getMedicationHistory",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getPrescriptionProgress

Source: backend/endpoints/medication-logs/get-prescription-progress

Input Fields

FieldTypeRequired
stackUserIdstringYes
prescriptionIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getPrescriptionProgress",
  "data": {
    "stackUserId": "stackuser_123",
    "prescriptionId": "prescription_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getTodaysMedications

Source: backend/endpoints/medication-logs/get-todays-medications

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getTodaysMedications",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMedicationSkipped

Source: backend/endpoints/medication-logs/mark-medication-skipped

Input Fields

FieldTypeRequired
stackUserIdstringYes
logIdstringYes
notesstringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMedicationSkipped",
  "data": {
    "stackUserId": "stackuser_123",
    "logId": "log_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMedicationTaken

Source: backend/endpoints/medication-logs/mark-medication-taken

Input Fields

FieldTypeRequired
stackUserIdstringYes
logIdstringYes
notesstringNo

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMedicationTaken",
  "data": {
    "stackUserId": "stackuser_123",
    "logId": "log_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMissedMedications

Source: backend/endpoints/medication-logs/mark-missed-medications

Input Fields

FieldTypeRequired
stackUserIdstringYes

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMissedMedications",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }