https://wiki.vertuna.com/display/CONFIFORMS/ConfiForms+Server+REST+API+version+1
After the recent update on 13.12.2024, the REST API endpoints `Validate ConfiForms Entry` and `Create ConfiForms Entry`
have stopped working. Prior to this update, both endpoints were functioning correctly with the same data. Post-update, I am encountering the following error for both endpoints:
Cannot read and parse field values. Entry mapping request must be in a JSON format, but it is not. JSONArray[0] is not a JSONObject (class java.lang.String : EU)
Before this update I was able to validate and create ConfiForms Entry as a child page from the parent template.
I suspect you are setting the multi-value field via the REST API and we had some regression for the short period of time. This has been addressed in version 3.15 - https://wiki.vertuna.com/display/CONFIFORMS/Release+Notes#ReleaseNotes-Version3.15
Alex
when I follow this syntax to create:
{
"fields": {
"mytextfield":"field value",
"datefield1": "2020-04-25",
"ready": true,
"mydropdown": 2
"multiselect": ["id1", "id2"],
"smartmultiselect": ["UUID1", "UUID2", "UUID3"]
}
}
Using my own dict with many keys and fields like:
- "myCustomKey": ["1", "2"]
I receive error: `JSONArray[0] is not a JSONObject (class java.lang.String : 1)`
When I modified this format to match the fields I received from the `Get form definition` endpoint, e.g.
- "myCustomKey": [{"1": "custom val 1", "2": "custom val 2"}]
- "myCustomKey": {"1": "custom val 1", "2": "custom val 2"}
- "myCustomKey": [{"id": "1", "value": "custom val 1"}, {"id": "2", "value": "custom val 2"}]
Then I receive that 'errors': [''My Custom Key' is required to be set'
So now I'm wondering what I'm doing wrong with this format
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are not doing anything wrong - as I have mentioned, you must be using the version of ConfiForms that has this unfortunate regression where the multi-value field mapping was not processed correctly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now I get it, thank you for your help, really appreciated it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error you're encountering suggests that the API expects the data in a specific JSON format, but it's receiving a string instead of a JSON object.
Here are a few steps to fix it:
Check the API Documentation: The update might have changed the expected data format. Review the documentation to see if any changes were made to the request structure.
Ensure Correct JSON Format: The data should be in JSON format, and fields that were strings might now need to be structured as JSON objects. For example:
{
"fields": [{"country": "EU"}]
}
Verify Content-Type: Make sure you're sending the request with the Content-Type: application/json
header.
Test with Simple Data: Try sending simplified data to ensure the structure is correct.
Check the release notes for the update on 13.12.2024 to see if any API format changes were made.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://wiki.vertuna.com/pages/diffpages.action?originalId=208994475&pageId=70582777
there is a small change regarding keys in the dictionary in `create` endpoint but this is not the problem, the problem is about json format of my data which has not been changed and everything worked fine before. Also there is no update in `validate` endpoint which returns this `Java Error`
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.