I'm working on a C# program that updates a LEAP document via REST API call.
The program first does a GET REST API call that returns this JSON Object:
===========
GET
===========
{{
"application_uid": "5c287256-7edf-4064-80c5-0e64f1f7833f",
"formId": "F_Form1",
"recordCount": 1,
"items": [
{
"lastModified": "2024-08-28T20:50:45Z",
"lastModifiedBy": {
"displayName": "joe doe",
"email": "joe.doe@test.com",
"login": "jdoe"
},
"created": "2024-08-28T15:43:11Z",
"createdBy": {
"displayName": "joe doe",
"email": "joe.doe@test.com",
"login": "jdoe"
},
"draft_ownerid": "",
"flowState": "ST_Submitted",
"id": 0.0,
"uid": "670f21ab-d9e1-407e-8d3a-340731e79caa",
"F_SingleLine1": "A",
"F_Number1": 1.0,
"availableSubmitButtons": [
"S_Update",
"S_Submit1"
]
}
]
}}
I then change the value of the "F_SingleLine1" field to a different value "B" and add "pressedButton": "S_Update" to the JSON Object:
===========
PUT
===========
{{
"application_uid": "5c287256-7edf-4064-80c5-0e64f1f7833f",
"formId": "F_Form1",
"recordCount": 1,
"items": [
{
"lastModified": "2024-08-28T20:50:45Z",
"lastModifiedBy": {
"displayName": "joe doe",
"email": "joe.doe@test.com",
"login": "jdoe"
},
"created": "2024-08-28T15:43:11Z",
"createdBy": {
"displayName": "joe doe",
"email": "joe.doe@test.com",
"login": "jdoe"
},
"draft_ownerid": "",
"flowState": "ST_Submitted",
"id": 0.0,
"uid": "670f21ab-d9e1-407e-8d3a-340731e79caa",
"F_SingleLine1": "B",
"F_Number1": 1.0,
"availableSubmitButtons": [
"S_Update",
"S_Submit1"
],
"pressedButton": "S_Update"
}
]
}}
Calling the PUT REST API returns an error: "StatusCode: InternalServerError, Content-Type: text/html, Content-Length: 647)"
Is there anything with how I have the JSON Object setup for the PUT operation that jumps out at you?
Going through the documenation here: https://leap.hcldoc.com/help/topic/LEAPv9/LEAP/ref_data_rest_api_update.html
shows a typical JSON payload of:
{
"uid": "f82e576f-cb67-4008-8219-f49a1b369f7d",
"flowState": "ST_ReviewStage",
"pressedButton" : "S_Approve",
"F_SingleLine1": "Jane",
"F_SingleLine2": "Test",
"F_Number1": 26.75
}
Wanting to use GET to pull in all of the field values, then use it to perform the PUT....