Hey Martijn,
I was posting to /webform/preview instead of /launch/get_survey_preview_url, it works fine now.
About possible changes to the API, from the formhub end, its much more flexible to have is such that we pass parameters to your /webform/preview url instead of posting, then getting the url before we can use it. I'm imagining a situation where the webform url can serve as a service to preview form xmls. It could be such that an application asks for permission to use the service from enketo, gets some kind of token that it can then re-use by simply posting the url to the form's xml.
At the moment, we have implemented the preview on the specific form page but if we were to add it to the form lis as well, it would mean making multiple posts to enketo just to retrieve the url on every page load.
I've copied the rest of the team to get their input on this as well.
On Fri, Jan 25, 2013 at 6:33 PM, Martijn van de Rijdt
<mar...@aidwebsolutions.com> wrote:
Hey Larry,
I must admit, I don't know much about cURL, but this works:
curl -X POST -d "server_url=http://formhub.org/formhub_u&form_id=tutorial" http://enketo.formhub.org/launch/get_survey_preview_url
I actually got this snippet from you :)
So, it must have something to do with the --data-urlencode flag that shouldn't be there.
All the enketo APIs use the same so what you're using for the edit POSTs and for the Enter Webform POSTs can also be used for this.
Not planning to restrict access, but preferable to use the API to get access as I may want to change things around later once enketo is stable (in one month...). I really need to work on the PHP side of things but am waiting for CodeIgniter 3 which should have built-in support for PHPUnit testing.
Cheers,
martijn
On Fri, Jan 25, 2013 at 7:40 AM, Larry Weya
<larr...@gmail.com> wrote:
Hey Martin,
I was trying to post to enketo to get the preview url using this command
But enketo gives back - Preview requires server url and form id variables. What am I doing wrong?
--
Larry Weya
--
Aid Web Solutions - www.aidwebsolutions.com
--
Larry Weya