Create long-term medication
Creates a new long-term medication.
Note: This endpoint requires a user-scoped OAuth token. A pure
client_credentialstoken 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
Header
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
customerUuid | string | Yes | UUID of the assigned customer |
medicamentName | string | Yes | Name of the medication |
medicament | string | No | Trade name / exact designation |
medicamentAmount | string | No | Amount (e.g. "1", "500") |
medicamentUnit | string | No | Unit (e.g. "Tablet", "mg") |
op | integer | No | Number of original packs |
dosage1 | string | No | Morning dosage |
dosage2 | string | No | Midday dosage |
dosage3 | string | No | Evening dosage |
dosage4 | string | No | Night dosage |
dosage5 | string | No | Additional dosage value |
dosageText | string | No | Free-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
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request data (e.g. customerUuid or medicamentName missing) |
| 401 | invalid_client | Invalid or missing access token |
| 403 | insufficient_scope | Scope medicals not present |
| 404 | not_found | Customer not found |