Survey App Django-Survey Monkey - django

I am creating a django application for my company, and one of the things that still needs doing is a survey.
At the moment we use SurveyMonkey, but I can't manage to send via api invitations to the surveys(personalized ones like the web page allows, so we know who answered with which answers).
Does anybody know if it's possible to do this with SurveyMonekey api, or if not, any other django app that what I need, or another way to do this?

SurveyMonkey's API is currently read-only and does not allow adding users to email collectors. And option you might consider is pairing SurveyMonkey with MailChimp. MailChimp currently has docs on how to use it with SurveyMonkey here: http://kb.mailchimp.com/article/setting-up-your-surveymonkey-mailchimp-integration/
You could also create something like the MailChimp API in your own application by adding a unique ID to links you send to your respondents by appending ?c=UNIQUEID to the end of a web link collector URI. Then, in your application, you can send any email invitation you like to potential respondents and use the unique ID to correlate users with responses.
You'll need to request the "custom_id" by adding it to the "fields" array in your request to get_respondent_list in order to that unique ID back from SurveyMonkey using the API.

Related

Using Firebase to make a simple group chat app, alongside an already existing django-react app

I have a basic project which uses django as backend and reactJS as frontend. Basically, it just shows a home page when a user logs in, and that's it. The sign up of new users is handled through the django.admin panel.
Now, I want to create a group chat for my users who are currently logged in using firebase. Here's the problem since I can't really understand the workflow on how I should proceed. My basic idea is that,
frontend gets the username and password from backend,
frontend posts them to firebase
firebase sends a unique id token to the frontend,
now frontend is logged in with both django and firebase,
users who are logged in joins in the group chat
Is there any guidelines on how I should proceed with this? I have read the docs but I can't really understand what I should be doing to go through with this.
You want to look at the docs for firebase.database().ref().on(<event here>) where <event here> is one of the firebase database events such as on, child_added, value
basically what you'll be doing is rendering a database ref, say: firebase.database().ref('livechat').on('value', snap => {render the snapshot}) to every client (to view the chat). Then, a user posts to the 'livechat' ref. You can add as much additional info to the users posted data (like uid) so that you can later filter the 'livechat' node by uid (or the like). Make sense?
Where it gets a bit trickier is when you want to have 1 on 1 chats. You can accomplish this in much the same way - maybe use one of the users uid as the ref. Like: firebase.database().ref(`chat/${user.uid}`).push(message_here so that when you render the chat in the client you have individual conversations.

Using Django with the Facebook API for a polling app

I randomly pick two friends of the user and ask him/her to pick who is the better friend. Now all I have is the friend ID which I then have to use to create a poll and store in the database accordingly. Using the Facebook graph API, I have the ID. All I need to do now is to pass it to Django.
I'm new to this so how exactly would I do that? Pass a javascript variable to Django?
I see two options.
At client side using Javascript SDK,
Fetch the friends' profile details along with ID.
Convert them to JSON.
Do a POST request to a django url/view which stores the data in database.
In this way, you don't need to do any graph API queries further from server side. But this won't help you updating the data at realtime. Consider, if one of the friends changing his name in FB, now what is stored in your database becomes obsolete. So, you need to make sure that some thing from client side implemented to do real time update posts to server side.
At server side using any django facebook graph API apps,
Get the IDs from client side.
Use the fb graph app to fetch the details at server side.
Store them in database.
In this way, you could be able to schedule a callback for real time updates. I prefer the second approach as it's always better to burden the server rather than client. And I found this app simple and do what you need. https://pypi.python.org/pypi/django-facebook-api/0.1.10

Using iframe for an application in external websites

I have a website built in Django. One feature of this website is booking hotels. Now, my client has many agents who have websites. We want to give the facility of booking on these websites. So, I am thinking to use iframe on these websites( with the consent of the respective agent owners), which will point to the booking page of our website. Once booking is done, we will return success message and email the user. IS this a viable solution? Or, are there any other options?
thanks
One way of doing this it's creating a rest api using a helper that works with django like django-piston so your agents could work with them to perform booking.
Should be easy to add a form to any agents site with this way. Or even using ajax if the uri returns a json.
Iframes is not the way you should go I think... I also think that you need to define the API on your website and then you just do requests from the client website to your backend.

How to post data to another website without using any browser related component?

I have a page where user is asked only for the payment amount, then user will be redirected to another website where the payment will be processed, I want the amount to be set on the redirected page without using querystring,cokkie, etc..
I tried to use web service but here is my challange:
user enters amount on the website.
webservice is called and set the amount to ex:400$
then user is redirected without any query string to another website.
Now:
how this payment website will know that this user is the user entered 400$ on the redirecting page?
I can count on approaches more secure than this also.
thanks
I have made some research on net and asked my experienced friends, the answer is "impossible" this way.
Because redirected website somehow identify that user and there is no solution without querystrings or browser related components,
Here is my friend's advice and i am little bit satisfied, not totally :)
He calls this approach as ticketing,
First create a datetime.now integer, with that number add id and amount of money to be processed.
Then make a complex function to encrypt data. take square of every odd digit then divide to 7 etc.
then on the other website, decrypt data and check datetime if its within 5 minutes for example,
the link is valid.
You have to pass the data to the other website somehow.
Cookies wouldn't work due to domain restrictions.
Query string or form posts could work, but you don't want to use query strings.
Alternatively, if both sites share infrastructure, you could use that to share information - for example if they both have access to the same database, you could use that to share data (though you would still need to identify the specific user to both sites).
The way the service would have to work is to give back some token, probably a GUID, that the site will then look for in the querystring of an HTTP request, to identify the owner of that pre-populated data. You then tack that token onto your redirect, and the client makes a request that causes the payment site to go pull the pre-loaded data for that client.
You still have to use a query string, but now, the query string doesn't contain any human-consumable information; they can't identify their $400 amount in the query string and change it to a different amount of money. If they change the GUID at all, the request will most likely fail as that GUID won't exist in whatever datastore of pre-populated data exists behind the payment site.
Contact the website/web service/gateway. They will provide you the API which will define parameters and methods to accept payment amount. If you are the author of such service, provide mechanism to accept such parameters from your caller application. Communication should be secure, using SSL.
For example for payment gateway Paypal, check this for ideas:
Use of the PayPal payment system in ASP.NET
Have a look on wikipedia.
Shortly the answer is impossible this way, because somehow the redirect website should identify the user, all the ways are browser related or ip ( which can cause many issues later)

How do I send an Enterprise Activation email? Using EnableBlackBerryUserDispatcherAttributes?

This is regarding a Blackberry that is connected to a BES Server, and the Administration Web Service.
I need to enable and send an Enterprise Activation email, however I need to also set an ActivationPassword.
I looked at the help document and after tracing the abstract classes, I think I need to do "something" with EnableBlackBerryUserDispatcherAttributes.
How do I send an enterprise activation email with a password to an Exchange user? I can't find anything, anywhere. (Sure I can add a user to the server, but what good is that if I can't activate the account !?)
I've found the following objects in the webservice that indicate it is possible, but I can't figure out how to use them...
ActivationPassword;
ActivationContext;
ActivationPasswordType;
ActivationPasswordOperationTypeEnumType;
clearActivationPassword;
EnterpriseActivationEvent;
setActivationPassword;
Just to be clear the online samples only address the creation of a user, not enabling them.
My alternative is to shell out $250 bucks for this missing documentation.
If you are an ISV partner or T3 subscriber, the answer to this question is free for you at devsupport#rim.com so I'll appreciate any strings you can pull as well. While you're at it I'd appreciate if you can tell me how to update the email component as described on this part of the admin website
The user list from the company
directory is automatically updated on
a timely basis. The update process can
be manually started using the email
component.
you should have a look at the dispatcher webservice. This means you have to generate a stub for the dispatcher webservice as shown in the tutorial. The stub is a instance of com.rim.bes.bas.baa.BAADispatcher which holds methods for setting and generating EA-passwords.
Regards