Hi GoodData team, How do I authorize against the ...
# gooddata-platform
p
Hi GoodData team, How do I authorize against the GoodData API if I want to call the API for white labelling? The docs on white labelling explains everything except how to authenticate. Do I have to create an API Key? Or do I have to pass my basic auth to the Authorization header (username:password)?
1
I've read the API Reference. I think I'm starting to get an idea of how to Login, request an SST, request a TT and then use the TT as a way to do other requests. It's still pretty disjointed 😕
Answering this in case the question is asked again: You can navigate to the Gray Pages at
https://{your-subdomain}.<http://on.gooddata.com/gdc/account/login|on.gooddata.com/gdc/account/login>
via your browser, and enter your credentials to login. NB that Gray Pages seem to have the limitation that some page do not allow to use other HTTP verbs than GET. If you need to use the API (and you most likely will), the following will do the job:
Copy code
curl \
-X POST \
https://{your-subdomain}.<http://on.gooddata.com/gdc/account/login|on.gooddata.com/gdc/account/login> \
-H 'Content-Type: application/json' \
-d '{"postUserLogin": {"login": "<mailto:you@yourcompany.com|you@yourcompany.com>","password": "my-password","remember": "0","verify_level": 0}}' \
-v;
And following that you will have to keep the Set-Cookie headers and send them back with every following requests. For this reason it may be easier to use a higher level library that supports cookie sessions, like python
requests
.