Save Reason
Systems can create or update reason details within the Donary system by using the Save Reason API.
Endpoint
/V1/External/SaveReason
Http Request Method
PUT
Request Header
APIKey - The API key for authorization.
Request Body
note
* Indicates required field.
* Provide if updating a reason.
* Either reasonName
or reasonNameHebrew
is required.
Name | Type | Description |
---|---|---|
orgGuid * | string | Organization's unique identifier. |
reasonNumber * | int | Reason number - if provided, the existing record will be updated. Click here for more information on this field. |
reasonName * | string | Reason English name. |
reasonNameHebrew * | string | Reason Hebrew name. |
Response
See list of possible errors.
Create Reason Example:
This example will create a new reason and return the reasonNumber
, 1001
.
note
Please note - A new reason will be created in this example because reasonNumber
is set to zero, which is not a valid id.
cURL:
curl --location --request PUT 'https://webapi.donary.com/V1/External/SaveReason' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","reasonNumber":0,"reasonName":"Reason A","reasonNameHebrew":"ריסאן א"}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"reasonNumber": 0,
"reasonName": "Reason A",
"reasonNameHebrew": "ריסאן א"
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"reasonNumber": 1001,
"reasonName": "Reason A",
"reasonNameHebrew": "ריסאן א"
}
Update Reason Example:
This example will update Reason 1001's reasonName
and reasonNameHebrew
.
note
Please note: In order to update a specific reason, the reasonNumber
must be included in the payload. Learn more about how to update a record here.
cURL:
curl --location --request PUT 'https://webapi.donary.com/V1/External/SaveReason' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","reasonNumber":1001,"reasonName":"Reason B","reasonNameHebrew":"ריסאן ב"}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"reasonNumber": 1001,
"reasonName": "Reason B",
"reasonNameHebrew": "ריסאן ב"
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"reasonNumber": 1001,
"reasonName": "Reason B",
"reasonNameHebrew": "ריסאן ב"
}