Last active
September 30, 2020 10:02
-
-
Save nicolaspanel/5e152e428228c5d988e2e6110c288a5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
API_TOKEN = "<YOUR-API-TOKEN>" # see https://www.callity.fr/configuration/integrations | |
resp =requests.post( | |
url="https://www.callity.fr/api/speech_source_reviews/", | |
headers={ | |
'Authorization': f'Bearer {API_TOKEN}', | |
}, | |
json=dict( | |
language="fr", # or "en" | |
recording='<SOME-URL>', | |
recordingFormat="mp3", # or "wav" | |
type='call', | |
# OPTIONNAL | |
# perChannelContext=[ | |
# dict( | |
# speakerFirstname='John', | |
# speakerLastname='Doe', | |
# speakerOrganizationName='Deleware Corporation', | |
# ), | |
# ], | |
# expectedPhrases=[ | |
# dict(text='foo'), | |
# dict(text='bar', channel=0), | |
# ], | |
)) | |
assert resp.status_code == 201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl https://speech.callity.fr/api/transcriptions/ \ | |
--header "Authorization: Bearer <API_TOKEN>" \ | |
--header "Content-Type: application/json" \ | |
--request POST \ | |
--data '{"recording":"<PUBLIC_URL_TO_YOUR_FILE>","recordingFormat":"wav","callbackUrl":"https://<YOUR_DOMAIN>/<ANY_ENDPOINT>"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
requests.post( | |
'https://speech.callity.fr/api/transcriptions/', | |
headers={ | |
'Authorization': f'Bearer {API_TOKEN}', | |
}, | |
json=dict( | |
recording=f'{PUBLIC_URL_TO_YOUR_FILE}', | |
recordingFormat='wav', # or 'mp3' or 'flac' | |
language='fr', # or 'en' | |
callbackUrl=f'https://{YOUR_PUBLIC_ENDPOINT}'), # take a look to https://ngrok.com/ (free) during development | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment