Using API to update form entry

By: Jan Theofel | Asked: 02/04/2023
ForumsCategory: General questionsUsing API to update form entry
Jan Theofel asked 2 years ago
Hello! I'm using Pabbly Connect (a no code platform like Zapier) to process data from my forms. Triggering the workflow there using a webhook works fine. But after processing the data I have to update the entry. And this failes. I'm using a POST request to the URL https://my.domain.tld/wp-json/frm/v2/entries/13/ where ID 13 is the id of my entry. (Backend edit is https://my.domain.tld/wp-admin/admin.php?page=formidable-entries&frm_action=edit&id=13 so this looks good.) The only update I'm sending is for a textfield with the ID 48. If I do the same update in the wordpress backend, everything is ok. But when I use the API to do the same update, I get an error "Date cannot be before Februar 5, 2023". This looks like an error for another field which is a date filed. That one is limited to dates in the future. But this field remains untouched by the update. And it's value is in the future. (The value it has before the update is running.) So I turned on logging to see what's going on. But unfortunately no log entries appear. Which seems to be another problem. I tried to replace the field id with it's key - but this does not solve the issue.

Attached you'll find a screenshot from the API request I am sending: How can I spot the error and fix it? Thanks!
Jan
Attachments
Question Tags:
Victor Font replied 2 years ago

There's no reason to ask the same question 6 times. Please keep all images and content in a single post. I've deleted the repeated posts. It's too difficult for any volunteer willing to answer your question to look at 6 different posts with the same title to u get an idea of the kind of help you're seeking.

Jan Theofel replied 2 years ago

Sorry. It seemed to me that the page was not loading.

5 Answers
Victor Font answered 2 years ago
Unless we've used the Pabbly API add-on ourselves, given you correct answers here may not be possible. As community volunteers answering questions on our own time, we can't support 3rd-party add-ons as a rule. All I can do is provide general guidance. The HTTP POST action is generally used for adding new entries, not updating existing entries. While it can be used, a better choice is PATCH or PUT. The PATCH or PUT actions update existing entry fields. In your attached screen print, you are receiving 3 values returned from Pabbly. I don't understand the simple response panel on your image. This is not part of a standard API add-on. What does this section do?
Jan Theofel replied 2 years ago

I posted this thread multiple times by accident. One of the deleted had the followup information that I tested serveral things and opend a support ticket. It looks like a bug because it only happens on certain entries. But we still did not understand the logic behind it.

Thanks for the hint with PATCH/POST. This was something I already changed with no effect.

Martin Splinter answered 2 years ago
Select 'PATCH' as the Method. This will ensure that only the posted fields are updated. or try PUT, give it a try. I use zapier, and POST did not work there as well
Jan Theofel replied 2 years ago

Thanks. That didn't help. It's some strange bug in FormidableForms or strange data. Support is working on it.

Martin Splinter answered 2 years ago
also , it might be an issue for you, but for basic auth the setting are specified as:
Basic Auth: API-KEY-HERE|x

That would result in (according to your screenshot) BJOD xxxxx in the left field and |x in the second field, thus with a | before the x, that could be a problem.

Also its wise to remove your api key from this forum, as now i could update your data.
Jan Theofel replied 2 years ago

Thanks. But the login works. I get a date error, not an authentification error. Support is working on it.

Martin Splinter answered 2 years ago
 "Date cannot be before Februar 5, 2023". This looks like an error for another field which is a date filed. That one is limited to dates in the future. But this field remains untouched by the update.

well  i hope so! since u do a POST u seem to be overwriting the entry

  • yoursite.com/wp-json/frm/v2/entries POST/PUT/PATCH create or update
  • yoursite.com/wp-json/frm/v2/entries POST Create an entry.

    the docs are not really clear, if u get an error on a wrong date for a field that u tink u are not updating, the fact that u get an error seems to imply that u actually are doing so.

    Using PUT or PATCH might solve it

Jan Theofel answered 2 years ago
Update: Even the support didn't find the issue. We solved it by deleting the field and creating a new one.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right