Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 Client Error: Bad Request for url: http://api.deepgram.com/ #1

Open
toofan0909 opened this issue Oct 27, 2017 · 4 comments
Open

Comments

@toofan0909
Copy link

I would really appreciate if you could create bit more documentation around deepgram

for example
step 1, create db object
step 2, upload a media (mp3/mp4/wav) file to dg
step 3, retrieve the text for the file
step 4, update the conversation

at the moment i am getting following error

[ERROR]: 2017-10-27 10:36:16,286 [C:\Python27\lib\site-packages\deepgram\deepgra
m.py:40] 400 Client Error: Bad Request for url: http://api.deepgram.com/
Traceback (most recent call last):
File "wit_test.py", line 23, in
print dg.check_balance()
File "C:\Python27\lib\site-packages\deepgram\deepgram.py", line 53, in check_b
alance
return self._make_request(data)
File "C:\Python27\lib\site-packages\deepgram\deepgram.py", line 38, in _make_r
equest
headers=self._get_headers(), params=data)
File "C:\Python27\lib\site-packages\deepgram\http.py", line 81, in post
return self._parse_response(response, format)
File "C:\Python27\lib\site-packages\deepgram\http.py", line 34, in _parse_resp
onse
response.raise_for_status()
File "C:\Python27\lib\site-packages\requests\models.py", line 862, in raise_fo
r_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://api
.deepgram.com/

@agouil
Copy link
Owner

agouil commented Oct 27, 2017

The deepgram API has been permanently moved to brain.deepgram.com. I'm planning to update the package over the next weeks to work with the new endpoint.
In the meantime, if you would like to make the changes and send a pull request, I'm happy to accept it.

@toofan0909
Copy link
Author

def init(self, api_key):
"""
Class constructor.

    Params:
        api_key (string): The API Key
    """

    self.api_key = api_key
    self.logger = logger()
    #self.client = Http('http://api.deepgram.com')
    self.client = Http('https://brain.deepgram.com')     #even this is not working 

@agouil
Copy link
Owner

agouil commented Nov 2, 2017

Deepgram have issued their own Python wrapper for the new API version, here: https://github.com/deepgram/deepgram-brain-python. It's build for Python 3. Maybe give this a try instead?

@toofan0909
Copy link
Author

currently working with that only ,, but that's in on python 3.. which I dislike for portability reasons ./...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants