Skip to content

Create long-term medication

Creates a new long-term medication.

Note: This endpoint requires a user-scoped OAuth token. A pure client_credentials token without user context will be rejected. The customer must belong to the same company as the authenticated user.

Request

POST /api/oauth/v2/resource/long-term-medications

HeaderValue
AuthorizationBearer {access_token}
Content-Typeapplication/json

Body parameters

FieldTypeRequiredDescription
customerUuidstringYesUUID of the assigned customer
medicamentNamestringYesName of the medication
medicamentstringNoTrade name / exact designation
medicamentAmountstringNoAmount (e.g. "1", "500")
medicamentUnitstringNoUnit (e.g. "Tablet", "mg")
opintegerNoNumber of original packs
dosage1stringNoMorning dosage
dosage2stringNoMidday dosage
dosage3stringNoEvening dosage
dosage4stringNoNight dosage
dosage5stringNoAdditional dosage value
dosageTextstringNoFree-text dosage instructions

Response

Success (201 Created)

json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "medicamentName": "Ramipril",
    "medicament": "Ramipril-ratiopharm 5 mg",
    "medicamentAmount": "1",
    "medicamentUnit": "Tablet",
    "op": 30,
    "dosage1": "1",
    "dosage2": "0",
    "dosage3": "0",
    "dosage4": "1",
    "dosage5": null,
    "dosageText": "1 tablet in the morning and evening",
    "customer": {
      "id": "f0e1d2c3-b4a5-6789-fedc-ba9876543210",
      "firstName": "Anna",
      "lastName": "Muster"
    }
  }
}

Response fields

See Get long-term medication for the full field description.

Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/long-term-medications" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "customerUuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
    "medicamentName": "Muster GmbH",
    "medicament": "beispiel",
    "medicamentAmount": "beispiel",
    "medicamentUnit": "beispiel",
    "op": "1",
    "dosage1": "beispiel",
    "dosage2": "beispiel",
    "dosage3": "beispiel",
    "dosage4": "beispiel",
    "dosage5": "beispiel",
    "dosageText": "beispiel"
  }'
Parameter
Zuerst Token anfordern

Possible errors

StatusCodeDescription
400validation_errorInvalid request data (e.g. customerUuid or medicamentName missing)
401invalid_clientInvalid or missing access token
403insufficient_scopeScope medicals not present
404not_foundCustomer not found

Offisy GmbH