Search code examples
apiauthenticationgooddata

How do I authenticate to the GoodData API?


I am trying to authenticate / login with the GoodData API but I am having trouble. On the GoodData API documentation site (docs.gooddata.apiary.io) it says to POST to:

URL:

https://secure.gooddata.com/gdc/account/login

Headers:

Accept: application/json
Content-Type: application/json

JSON Body:

{"postUserLogin":{"login":"[email protected]","password":"YourPassword","remember":1}}

I get the response "Private API, please provide private hash." Any ideas?


Solution

  • The updated GoodData API documentation and API console is located at https://developer.gooddata.com/api

    The login URL for this call is actually https://secure.gooddata.com/gdc/account/login

    Using the same payload (your credentials instead of sample) you will be able to login and get the SST Token that is returned back in SetCookie header.

    Please remember the process to login is:

    1. POST your credentials to the login resource as mentioned here
    2. SST Token is returned back in SetCookie header
    3. GET the token resource with SST Token in your header to receive TT Token
    4. Use the TT Token in your API calls header: -cookie

    Also, please remember that TT Token has limited validity. Once you received 401 Unauthorized Response, you need to GET new TT Token in following resource with SST Token specified in call header.