I'm trying to submit JSON data directly to a webform through some restful resource. My thought was to create a webform, enable webform_service, and then post directly to the endpoint. This lead me to try something like this:
curl -vv -X POST -H "Content-Type: application/json" -d '{"title":"Contact Us", "submitted[contact_fullname]": "my name", "submitted[contact_email]": "[email protected]", "submitted[contact_message]": "test message"}' http://localhost/api/contact_us.json
But this does not work. In fact without the "title" value I get "title field is required", which seems to be trying to create a new webform, and in fact if I provide a title, a new webform is, in fact, created. But this is not what I'm looking to do - I'm trying to submit a new entry into the existing webform.
I thought that perhaps there's a different resource that I should be submitting form data to:
curl -vv -X POST -d 'submitted[contact_fullname]=sundartest&submitted[contact_email][email protected]&submitted[contact_message]=test_message' http://ike.localhost/api/contact_emc.submission
But obviously this is wrong and I'm just guessing!
Any pointers on how I can accomplish this?