webASR API
webASR now allows usage through a programmatic API. This allows users to develop tools to automate uploads and retrieval of results. The API is based on HTTP POST and GET commands using webASR RESTful architecture. These are an example of the API access using the Unix cURL command and the Python requests package. It requires you to use your login credentials (email and password).
Listing available systems
- Command (cURL): curl --form submit=OK --form email="your_email" --form password="your_password" http://www.webasr.org/system_list
- Command (Python): r=requests.post("http://www.webasr.org/system_list",data={'email':'your_email','password':'your_password'})
- Outcome: A list of available systems using the fields "language", "environment" and "systems"
- Command (cURL): curl --form submit=OK --form email="your_email" --form password="your_password" --form language="language" --form environment="environment" --form systems="systems" --form "metadata=@your_file.xml" --form "file1=@your_file1.wav" --form "file2=@your_file2.wav" http://www.webasr.org/newupload
- Command (Python): r=requests.post("http://www.webasr.org/newupload",data={'email':'your_email','password':'your_password','language':'language','environment':'environment','systems':'systems'},files={'metadata':open('your_file.xml','rb'),'file1':open('your_file1.wav','rb'),'file2':open('your_file2.wav','rb')})
- Notes: Only valid combinations of "language", "environment" and "systems" will produce a successful upload. Fields"file1" requires a valid audio file. File "metadata" is optional. Extra channels "file2", "file3", ... are optional.
- Outcome: If upload is successful, two fields will be returned "src" and "ses"
- Command (cURL): curl --form submit=OK --form email="your_email" --form password="your_password" --form src="XXXXX" --form ses="YYYYYYYYYYYYYYYYYYYYYYY" http://www.webasr.org/getstatus
- Command (Python): r=requests.post("http://www.webasr.org/getstatus",data={'email':'your_email','password':'your_password','src':'XXXXX','ses':'YYYYYYYYYYYYYYYYYYYYYYY'})
- Notes: Only valid combinations of "src" and "ses" will return the status. Processing is complete when the status "Transcription completed" is received.
- Outcome: The current status of the upload
- Command (cURL): curl --form submit=OK --form email="your_email" --form password="your_password" --form src="XXXXX" --form ses="YYYYYYYYYYYYYYYYYYYYYYY" http://www.webasr.org/getfile
- Command (Python): r=requests.post("http://www.webasr.org/getfile",data={'email':'your_email','password':'your_password','src':'XXXXX','ses':'YYYYYYYYYYYYYYYYYYYYYYY'},stream=True)
- Notes: Only valid combinations of "src" and "ses" will return the status. Files with a status different to "Transcription completed" or "Processing. Partial transcript available." will return an error.
- Outcome: If processing of upload is complete, a ZIP file containing all the outputs will be dumped