Survey Monkey - Get form data - API - surveymonkey

I'm trying to get the field values submitted through survey monkey forms. Since its in a seperate iframe, i cant access it from my domain (CORS). Is there any api to get the individual responses submitted through these forms?

You mean you're using a website collector and the responses are embedded on your website, and you want to read the responses in javascript when the user submits the form? Yes that won't work.
Either way I think the best way to do it is to use the API.
You can fetch the list of survey responses (and their details) see the docs.
To get the list of responses for a survey you would do:
GET /v3/surveys/<survey_id>/responses
You can filter by date or other fields (if you need be).
You can fetch the full details with
GET /v3/surveys/<survey_id>/responses/<response_id>
Alternatively, you can setup a webhook where you'll be notified every time a new response comes in, you can then make the request defined above to get the details of the response.
Hopefully those options work for you, I don't know your use case well enough to give other options.

Related

Website contact form to Asana Api

I am interested to allow my website to send a webform data to an asana project, its for collecting responses from potential clients.
I am unsure the best way to do this, since by using the form, I do not want that the user is required to login, or signup, or anything such as that, the form submission should be anonymous, it should just take whatever is posted and create a task in asana with the text given.
From the documentation, it appears that its always required to login, or connect with asana and this obviously isn't going to work since people are not going to do that in order to send me feedback from the website.
So, is there a way to do this, in the way mentioned above?
You're right in that you need to have an Asana account to make API calls as a particular user. However since you want the submissions to be anonymous anyway, there's a pretty simple way: you can create a bot account and use that to submit the form. For instance, create an Asana user called "forms_bot#yourdomain.com"; make sure it can see the project in which you want to collect the form submissions. Get its credentials from inside Asana, and use these on your server to make the API calls to Asana to submit the information. In this way you will see the tasks created by "forms_bot#yourdomain.com".
We use this idiom very frequently at Asana for these sorts of flows, and as an added plus it makes it very clear where the information came from in the first place (as opposed to seeming as if there were an actual user in your domain that's creating the tasks). Hopefully this makes sense and will allow you to get the workflow you want set up!

Get Attendee Data w/ Website Workflow's 3rd Part Next Steps

I am working w/ the Event Brite API and I have a need that I am trying to figure out the best approach for. Right now, I have an event that people will be registering for. At the final step of the registration process, I need to ask them some questions that are specific to my event. Sadly, these questions are data-driven from my website, so I am unable to use the packaged surveys w/ Event Bright.
In a perfect world, I would use the basic flow detailed in the Website Workflow of the EB documentation, ending upon the "3rd Party Next Steps" step (redirect method).
http://developer.eventbrite.com/doc/workflows/
Upon landing on that page, I would like to be able to access the order data that we just created in order to update my database and to send emails to each person who purchased a seat. This email would contain the information needed to kick off the survey portion of my registration process.
Is this possible in the current API? Does the redirect post any data back to the 3rd party site? I saw a few SO posts that gave a few keywords that could be included in the redirect URL (is there a comprehensive list?). If so, is there a way to use that data to look up order information for that order only?
Right now, my only other alternative is to set up a polling service that would pull EB API data, check for new values, and then kick off the process on intervals. This would be pretty noisy for all parties involved, create delay for my attendees, and I would like to avoid it if possible. Thoughts?
Thanks!
Here are the full set of parameters which we support after an attendee places an order:
http://yoursite.com/?eid=$event_id&attid=$attendee_id&oid=$order_id
It's possible that order_id and attendee_id would not be a numeric value, in which case it would return a value of "unknown." You'll always have the event_id though.
If you want to get order-specific data after redirecting an attendee to your site, you can using the event_list_attendees method, along with the modified_after parameter. You'll still have to look through the result set for the new order_id, but the result set will be much smaller and easier to navigate. You can get more information here: http://developer.eventbrite.com/doc/events/event_list_attendees/
You can pass the order_id in your redirect URL in order to solve this.
When you define a redirect URL, Evenbrite will automatically swap in the order_id value in place of the string "$order_id".
http://your3rdpartywebsite.com/welcome_back/?order_id=$order_id
or:
http://your3rdpartywebsite.com/welcome_back/$order_id/
When the user completes their transaction, they will be redirected to your external site, as shown here: /http://developer.eventbrite.com/doc/workflows/
When your post-transaction landing page is loaded, grab the order_id from the request URL, and call the event_list_attendees API method to find the order information in the response.

Play Framework - GET vs POST

New to web development, my understanding is that GET is used to get user input and POST to give them output. If I have a hybrid page, eg. on StackOverflow, if I write a question, it POSTs a page with my question, but also has a text box to GET my answer. In my routes file, what method would the URL associated with my postQgetA() method specify - GET or POST?
From technical point of view you can use only GET to perform almost every operation, but...
GET is most common method and it's used when you ie. click on the link, to get data (and do not modify it on server), optionally you send id of the resource to get (if you need to get data of single user).
POST is most often used to sending new data to the server ie. from form - to store them in your database (or proccess in any other way)
There are also other request methods (ie. DELETE, PUT) you can use with Play, however some of them need to be 'emulated' via ie. ajax, as there is not possible to set method of the common link ie. to DELETE. It's described how to use non-GET/POST methods in Play! (Note, that Julien suggests there, using GET for delete action although is possible it's a broken semantics.)
There are also other discussions on StackOverflow where you can find examples and suggestions for choosing correct method for your routes.
BTW, if you sending some request, let's say it's POST you don't need to perform separate GET as sending a request generates a response in other words, after sending new question with POST first you're trying to save it to DB, if no errors render the page and send it back in response.

Rails Nested Attribute Forms and HTTP Request Limits

I've read many posts about doing Rails nested forms, which I think I understand. And I've read several posts about limits on HTTP GET requests, which I also think I understand. But I have not seen any question/answer regarding their combination, so here goes...
If the limit on an HTTP request is somewhere between 256 and 2048 (approximately, and depending upon browser, server configuration, etc, etc), does this then put a caution on how elaborate one gets with a nested attribute form in Rails? So I have, for example, an Service Invoice form which has work items (that include descriptions for each) as a nested attribute (separate SQL table) and a list of payments (another nested attributes). If make all this editable on one form and want to do a Submit button to update all the data, does Rails attempt to pass all this stuff in one HTTP request string back to the server? So then, if it's possible that all my invoice header info, work item descriptions, and payment descriptions all total more than, say, about 2K bytes of info, I will not be able to use a single nested form for data entry?
Thanks.
The HTTP request limits you mention are only for GET requests; that is, those are limits on the length of a URL, and in a GET request, all data is included in the URL.
However, a form submission that is meant to create or update a resource should always be a POST or PUT request, not a GET. The only time this would be an issue would be if you were, for example, doing a very elaborate search form, so that you were filling out a complex form but doing a GET request (i.e. not doing any update). That seems unlikely, and in that case it would probably be appropriate to turn that into a POST (e.g. identify a new resource that you're creating).

Using GET request instead of POST one

The issue is that there is a form I want to fill. It's submitted via a POST request. But technically I can use only GET requests (pass an URL with GET parameters). And I don't have access to a server where the site (with a form to fill) is located.
I've tried to use POST params in GET request, but it didn't work. The other thing that came to my mind was to send GET request to my own server, which will perform the desired POST request. But I need the request to be commited from my IP, but not from the server's one...
Can anybody give some piece of advice concerning solving this problem?
Is this homework? Seems odd that you wouldn't be able to use a POST.
Regardless,
The best way to do this would be to override the onclick event of your submit button; the JS function could poll for the fields you are looking to submit. Then use encodeURIComponent() on the values to get them sent to your webserver correctly.
Here you would be able to load the new page with the get?element=value&.... request.
http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp
Firefox allows you to turn an HTML form (either GET or POST) with at least one regular text input field into a search keyword bookmark, although I'm not sure how easy it is to import and export an individual bookmark from one copy of Firefox to another.

Resources