yandexmobile / appmetrica-funnels

Analytic funnels based on AppMetrica events
Other
19 stars 5 forks source link

Cannot setup OAuth key #4

Closed amosbird closed 6 years ago

amosbird commented 6 years ago

Hi, I'm trying to test this in my local machine. I followed the tutorial, generated an OAuth key and an application id. After filling them into TOKEN and API_KEYS I got

web_1         | Exception in thread Thread-1:
web_1         | Traceback (most recent call last):
web_1         |   File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
web_1         |     self.run()
web_1         |   File "/usr/local/lib/python2.7/threading.py", line 754, in run
web_1         |     self.__target(*self.__args, **self.__kwargs)
web_1         |   File "./run.py", line 35, in update_loop
web_1         |     updater(first_flag=True)
web_1         |   File "/usr/src/logs_api_int_script.py", line 265, in main
web_1         |     process_date(date_str, token, api_key, CH_DATABASE, CH_TABLE)
web_1         |   File "/usr/src/logs_api_int_script.py", line 203, in process_date
web_1         |     raise ValueError, r.text
web_1         | ValueError: Don't have rights for this

Is there a more elaborate tutorial for this? Or is there a sample database that I can test directly? Thanks.

bamx23 commented 6 years ago

Do you use docker-compose or start with docker commands? Does your account (of the token) have access to the app with that id? Looks like there is something wrong with the token.

amosbird commented 6 years ago

Do you use docker-compose or start with docker commands?

I used docker-compose command.

Does your account (of the token) have access to the app with that id?

Um, I'm not sure. How can I test that?

bamx23 commented 6 years ago

You've generated OAuth token for some account by opening URL as it described here: https://tech.yandex.com/oauth/doc/dg/reference/console-client-docpage/ And also your OAuth application should request access for reading AppMetrica data.

amosbird commented 6 years ago

I don't get it. This is the client I've created image

and this appmetrica application

image

What else should i do then?

bamx23 commented 6 years ago

You need to generate OAuth token for this client (it's not an ID or a password from your screenshot). Also, API_KEYS should be ["962757"].

amosbird commented 6 years ago

You need to generate OAuth token for this client

Oh, ok. But I don't find the place to generate this...

bamx23 commented 6 years ago

Open this URL(use your client ID): https://oauth.yandex.com/authorize?response_type=token&client_id=<application ID> from here: https://tech.yandex.com/oauth/doc/dg/tasks/get-oauth-token-docpage/

amosbird commented 6 years ago

Thanks! I'm making progress now image

So what callback url should I setup?

bamx23 commented 6 years ago

See this page: https://tech.yandex.com/oauth/doc/dg/tasks/register-client-docpage/ You should have been clicked Set URL for development when you were creating a client.

amosbird commented 6 years ago

Thanks!