Client error: `POST https://my.wordpress.site/wp-json/frm/v2/entries/119` resulted in a `409 Conflict` response:
{"code":"frmapi_validate_entry","message":{"form":"There was a problem with your submission. Please try again."},"data": (truncated...)
{"form_id":2,"6":"DEMO ","22":"No","23":"Yes","21":"2022-01-18","26":"#sign-up","25":"conference-demo","9":"
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu.
","13":"Monday, January 17th, 2022","65":"
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu.rn
rn
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu.rn
","38":"This is the tagline.","16":"2022-01-17","17":"2022-01-17","14":"9:00AM - 4:00PM America/Los_Angeles","15":"Free","39":"https://my.domain/app/default/assets/images/laravel_streams_black_line_logomark.png?v=1698110827","40":"#instagram","41":"#twitter","speakers": { [foreach 42] "[id]":{ "45": "Ryan","46": "Ronin","66": "Sir","48": "
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu.
","49": "https://my.domain/app/default/assets/innovators/me2.jpeg?v=1698110827" },"[id]":{ "45": "Ryan","46": "Thompson","66": "Bruh","48": "
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu.
","49": "https://my.domain/app/default/assets/innovators/me2.jpeg?v=1698110828" } [/foreach 42] },"image_gallery": { [foreach 54] "[id]":{ "56": "https://my.domain/app/default/assets/images/doctor-preparing-covid-19-vaccine.jpg?v=1698110828" },"[id]":{ "56": "https://my.domain/app/default/assets/images/harlie-raethel-ouyjDk-KdfY-unsplash.jpg?v=1698110828" },"[id]":{ "56": "https://my.domain/app/default/assets/images/hero-group.jpg?v=1698110828" },"[id]":{ "56": "https://my.domain/app/default/assets/images/brain-study-background-mental-health-care-medical-technology.jpg?v=1698110828" },"[id]":{ "56": "https://my.domain/app/default/assets/images/pexels-anna-shvets-4226256.jpg?v=1698110828" } [/foreach 54] },"sponsors": { [foreach 50] "[id]":{ "52": "#1","53": "https://my.domain/app/default/assets/resources/Untitled-1.jpg?v=1698110828" },"[id]":{ "52": "#2","53": "https://my.domain/app/default/assets/resources/Untitled-2.jpg?v=1698110828" },"[id]":{ "52": "#3","53": "https://my.domain/app/default/assets/resources/Untitled-3.jpg?v=1698110828" },"[id]":{ "52": "#4","53": "https://my.domain/app/default/assets/resources/Untitled-4.jpg?v=1698110828" } [/foreach 50] },"downloads": { [foreach 57] "[id]":{ "59": "dummy.pdf","60": "https://my.domain/file/download/dummy.pdf" },"[id]":{ "59": "dummy.pdf","60": "https://my.domain/file/download/dummy.pdf" } [/foreach 57] },"links": { [foreach 61] "[id]":{ "63": "Google","64": "https://google.com" } [/foreach 61] }}
{"form_id":2,I get a successful post, but the repeaters have no data in them in Formidable.
"6":"Town Hall ",
"22":"Yes",
"23":"Yes",
"21":"1969-12-31",
"26":null,
"25":"cchmc-town-hall",
"9":"<p>Town Hall #9<\/p>",
"13":"Friday, January 14th, 2022",
"65":null,
"38":"Join the conversation ",
"16":"2022-01-14",
"17":"2022-01-14",
"14":"8:00AM - 9:00AM America\/Los_Angeles",
"15":null,
"39":"",
"40":null,
"41":null,
"ctlgo": {
"form": 5,
"0":{
"45": "Jeffery",
"46": "Anderson",
"66": "MD, MPH, MBA",
"48": "<p>-</p>",
"49": "https://my.domain/app/default/assets/images/Screen Shot 2022-01-11 at 12.59.57 PM.png?v=1698118224"
},
"0":{
"45": "Shelly",
"46": "Voet",
"66": "MD",
"48": "<p> -</p>",
"49": "https://my.domain/app/default/assets/images/Shelly Voet MD.jpg?v=1698118224"
}
},
"keo9d": {
"form": 7,
"0":{
"56": "https://my.domain/app/default/assets/images/screen_shot_2022-01-11_at_12.22.33_pm.jpg?v=1698118224"
}
}
}
Thanks Victor. If you look at the first post the example code I'm attempting to send DOES have "[id]". it also has the [foreach xx] ... [/foreach xx] code in it. But if I attempt to send this as raw with no json headers I get the 409 error. If I have the json headers with this raw data I get the 400 error that the json is invalid.
Bear in mind I am NOT sending FROM formidable to another formidable form. I am attempting to send data from a Laravel site using Guzzle (curl) to populate this form with repeaters in it. So if the shortcodes are intended to be dynamically replaced when the data is SENT to formidable and not being read in and applied on receipt then I need to know the format for the data that Formidable will receive it. Should it be receiving valid json?
If you're not sending from Formidable, the shortcodes are never going to work, but you already know that. You wouldn't even be able to test this in Postman, which is usually the first step in formatting RAW JSON.
I would set up a development instance of Formidable with a duplicate of the intake form and same data to output the RAW JSON in the format it expects, then use it as a model for constructing the RAW JSON from Laravel/Guzzle. You can review the Formidable generated REQUEST either in your browser's development tools or by using the Logging add-on.
Please login or Register to submit your answer
The problem I think is the completely invalid json format that formidable says to use with the [foreach xx] ... [/foreach xx] code in the json data.
I added Content-Type: application/json and Accept: application/json to my headers and now entries post properly but only when they DO NOT have any of the repeater field data. If there's repeater field data I get:
Bad Request` response:
{"code":"rest_invalid_json","message":"Invalid JSON body passed.","data":{"status":400,"json_error_code":4,"json_error_m (truncated...)
The formidable api docs say to send data as RAW but that's what I was trying to do and every single call failed with the 409 error even without any repeater data.