Question
Smart Communications
HU
Last activity: 14 Sep 2024 3:55 EDT
Create data record V2 DX API call fails with Invalid request payload error, HTTP 422 code
Hi everyone,
I'm having trouble creating a record with DX API using a savable data page. The API call is successful only if the payload contains just the key field of the data type. If I specify any other field, the call fails with the following response:
Code Details
422 Error:
Response body
Download
{
"errorClassification": "Validation fail",
"localizedValue": "Validation failed.",
"errorDetails": [
{
"message": "ERROR_INVALID_REQUEST_PAYLOAD",
"erroneousInputOutputFieldInPage": "",
"erroneousInputOutputIdentifier": "",
"errorClassification": "",
"localizedValue": "Invalid request payload",
"messageParameters": []
}
]
}
In the logs, I see the following:
For D_apitestdatatypeSavable, the field fieldB wasn't found in the view Create for the flow action CREATE
Fields are invalid for the data view 'D_apitestdatatypeSavable' - action 'CREATE'
Invalid request payload I have a data type with ID MyOrg-Siqdemos-Data-ApiTestDataType, it contains two text fields, fieldA and fieldB. I generated the data pages on the Sources tab of the data type. The key of the type is fieldA. The ID of the savable data page is D_apitestdatatypeSavable.
The REST operation is POST /data/{data_view_ID} Create data record. The request body is:
Hi everyone,
I'm having trouble creating a record with DX API using a savable data page. The API call is successful only if the payload contains just the key field of the data type. If I specify any other field, the call fails with the following response:
Code Details
422 Error:
Response body
Download
{
"errorClassification": "Validation fail",
"localizedValue": "Validation failed.",
"errorDetails": [
{
"message": "ERROR_INVALID_REQUEST_PAYLOAD",
"erroneousInputOutputFieldInPage": "",
"erroneousInputOutputIdentifier": "",
"errorClassification": "",
"localizedValue": "Invalid request payload",
"messageParameters": []
}
]
}
In the logs, I see the following:
For D_apitestdatatypeSavable, the field fieldB wasn't found in the view Create for the flow action CREATE
Fields are invalid for the data view 'D_apitestdatatypeSavable' - action 'CREATE'
Invalid request payload I have a data type with ID MyOrg-Siqdemos-Data-ApiTestDataType, it contains two text fields, fieldA and fieldB. I generated the data pages on the Sources tab of the data type. The key of the type is fieldA. The ID of the savable data page is D_apitestdatatypeSavable.
The REST operation is POST /data/{data_view_ID} Create data record. The request body is:
{
"data": {
"fieldA": "foo1",
"fieldB": "bar1"
}
}
The question is, what am I doing wrong?
Some screenshots of the configuration:





@RobertR16597299
From App Studio navigate to the data type -> view and create view rule with name Create add fields to this view which are required for insert operation, now try to insert records it will work.
Repeat the same when you want to Update a record. View name will be pyEdit.