Amazon Mechanical Turk: Created a Job using website UI, but would like to accept/reject jobs using the Python API - mechanicalturk

I created a data collection Job (HITs) using the mechanical turk website.
I would like to reject/approve jobs using python API, because that would accelerate the process.
I can approve the process using the python API, but that doesn't update the Assignment status on the website. Does anyone have any idea on this?
Thanks.

Unfortunately, HITs created through the website are not visible or manageable in the UI (and vice-versa). So, that's why you can't see or operate on them via API calls. You'll need to create the HITs
You can reuse the layouts created in the website, though. Check out this article: https://blog.mturk.com/tutorial-using-the-mturk-requester-website-together-with-python-and-boto-4a7ef0264b7e

Related

Cannot see my MTurk HIT (as a worker) created from the API using boto3 and Python

I am planning to do a large scale crowdsourcing experiment on MTurk and would therefore like to do this using the API and Python, since I am very interested in the ReviewPolicies Feature. I tested this (not only in the sandbox, but also in the marketplace) and can't find my created test HIT (reward set to 0.01).
What could be the reason for this? Also I read in in some prior tasks, that HITs created with the API are not visible in the developer interface. But they must be visible to workers on the website interface, aren't they? If not, how will these HITs be found by workers on the dashboard/marketplace?
I published the HIT successfully on the marketplace (API) and I can see the HIT response. I expected to find this specific HIT also on the dashboard (signed in as a worker).

Mechanical Turk - API created hits are not shown under batches

I've created around a few hundred HITs using a Python API, but they aren't shown under the manage -> results.
Is there a way to view HITs created by Python?
The ability to see HITs created through the API (regardless of language used) was removed from the website in December 2017. This blog post describes a workaround, using the AWS CLI, to see these HITs.
https://blog.mturk.com/upcoming-changes-to-the-mturk-requester-website-and-questionform-data-format-f7c3238be58c

In Amazon Mechanical Turk, Batch HITs remain in mTurk website UI Manager after approving HITs with API

I am currently creating a Batch Project via the Amazon Mechanical Turk website (http://requester.mturk.com). After all the HITs have been completed, I download the CSV and approve or reject the hits.
I am then iterating through the CSV and using the mTurk API to call ApproveAssignment or RejectAssignment on the AssignmentId for each row.
When looking as a Worker (in which I completed my own HITs for testing), I see that HITs have been properly approved or rejected. However when looking as the requester it appears that none of the assignments have been approved or denied and the batch project looks like it is still waiting to be reviewed.
Any thoughts? Any help would be greatly appreciated.
Thanks!
This is a known issue. Once you operate on a HIT via the API, the batch interface no long works correctly.
The Manage HITs Individually page should still be updated correctly, though.

Google Apps Contact Sync

We're developing an application and we want to setup a bi-directional sync with Google Contacts.
The process: They setup their Google Accounts and the application make the sync between their Google account and our database.
The first approach is to create a CRON that will fetch modifications to the API but this is not very efficient as we'll need to run the CRON very often.
Do you know if there is any way Google can "notify us" of a modifications ?
Maybe from a script we execute on their servers directly ? (Like Google Scripts) We'll then be able to call our app to make a new fetch.
There is no method to have changes "pushed" to your app. However, when polling for changes, you can minimize the traffic by using the updated-min parameter as described at:
https://developers.google.com/google-apps/contacts/v3/reference#Parameters
and:
https://developers.google.com/google-apps/contacts/v3/#retrieving_contacts_using_query_parameters

Can you create Google Forms from Google Docs in an application?

I am thinking about app that will use google form and I need to create forms from that app. Is there a way how can I create form in google docs without using website but through some api or some other way?
I can offer an idea for a solution using Google App Script.
Since the beginning of 2013 you can create new forms using the App Script Forms Service API quite easily.
var form = FormApp.create(title)
.setDescription(description)
.setConfirmationMessage('Thanks for responding!')
;
The problem now is how to get that App Script running from your non App Script code.
You can use App Script to create a Web App that reacts to HTTP GET requests.
So putting it together, you may be able to create an App Script Web App that reacts to a GET request and when it gets the right URL parameters, it creates the form.
(Nov 2020) Yes, it is possible to programmatically create Google Forms. You can do it with Google Apps Script using its Forms service. You can also extend the code to read in the contents from Google Docs (with Apps Script's Document service) and use it for the creation of Google Forms.
I created a Google Workspace (formerly G Suite) Add-on, which you can think of as a Google Docs extension, called GFormIt. Its original purpose was intended for teachers to write exams/quizzes, possibly with answers, in Google Docs, then automatically convert them to Google Forms to distribute to students who submit their answers into Google Sheets (the destination for Google Forms submissions).
Furthermore, if you (the teacher) provided answers to your test questions, GFormIt would also auto-submit your answers to the Sheet as if you were a student. If you do that, and use a tool like Flubaroo to grade the exam, you could designate your row in the Sheet as “the answer key.” You can learn more about how it works, including viewing a short video, at the GFormIt page linked above.
This Google Docs add-on, along with others for Google Docs, Sheets, Slides, Forms, etc., are all certified/validated by Google and available for free to anyone from the Google Workspace Marketplace. (However, your admins may have to grant permissions for you to try to install them to your corporate Workspace account.) If interested in building your own add-on, please see the developer documentation and perhaps some of my introductory videos to get started, the most relevant being the one linked to at the top of this answer.
Apps Script is a serverless Google technology, meaning you write your code (using JavaScript) in the browser, and it is hosted by & executed on Google servers. If you wanted to create your own web app (and hosted anywhere), you would have to wait for a Google Forms REST API which does not exist at the time of this writing. (If we ever launch one, you'll find its documentation at https://developers.google.com/forms along with the others like Sheets https://developers.google.com/sheets, Gmail https://developers.google.com/gmail, Drive https://developers.google.com/drive, etc.)
Earlier this year (Mar 2022) the new Google Forms Api graduated from Beta. It is more powerful that the previous versions and caters for two main use cases:
Automated form creation and editing: Enables automated form creation
and editing. Enables rapid form generation from large volume question
banks or other data backends.
Reaction to Form responses: The API also enables developers to build
automations for acting on incoming responses. Examples include
developing real-time dashboards or visualizations and triggering
business workflows based on response data.
We have used it to build an integration that Creates documents and slides each time a form is completed: www.portant.co/google-forms-to-docs and it works really well.
I think the other key use case looks like it would be a good fit for you and others looking for a solution like this.
Cheers, James
Sorry, the API doesn't support programmatically creating forms.