Issue with CONFIFORM REST API version-1 Endpoints After Update on 13.12.2024

Patryk Janiewski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

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)

 

  • No changes have been made to the data being sent to the endpoints.
  • The issue started immediately after the update on 13.12.2024.

Before this update I was able to validate and create ConfiForms Entry as a child page from the parent template.

2 answers

0 votes
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2024

Hi @Patryk Janiewski 

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

Patryk Janiewski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

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

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2024

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

Patryk Janiewski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

Now I get it, thank you for your help, really appreciated it

0 votes
Shahid Iqbal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

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:

  1. 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.

  2. 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"}]
    }
  3. Verify Content-Type: Make sure you're sending the request with the Content-Type: application/json header.

  4. 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.

Patryk Janiewski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

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`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events