Forum Discussion

juankypanky's avatar
juankypanky
Frequent Visitor
4 years ago
Solved

Setting up an Odata connection for Cornerstone API Reporting connector

Dear Power BI team.

I'm trying to connect Power BI with the API Cornerstone HCM using OAUth 2.0. This vendor provides a TXT file to import in Power BI desktop with the setup config to make the connection. I have all the necessary data: the id client, the secret token, API's endpoint, etc. I followed the steps of this article in their support site: 

https://csod-external.force.com/supportcentral/s/article/How-do-we-integrate-Power-BI-with-the-Reporting-API

 

Something was wrong in point 9 (Option 2) beacuse if I check "Ignore privacy levels" the screen appears over and over again, and it seems like there is a lack of data or configuration that the article does not include. I opened a support ticket, but the answer is that there are no support for third-party vendors.

 

Anybody has tryed to make a similar connection to the Cornerstone API or similar?

 

Thanks in advance! 

  • RichardR's avatar
    RichardR
    4 years ago

    Can you confirm you have the two scopes below selected for the App on the Cornerstone side. My issue was similar where it was working in Postman but not in PowerBi until I enabled the scope reportingmetadata:view. Another thing you could try for troubleshooting is setting the app to a user that has full permissions in Cornerstone with all the scopes enabled. If it works then it would just be narrowing it down to the permissions you are missing.

     

     

     

7 Replies

  • juankypanky's avatar
    juankypanky
    Frequent Visitor

    Adding some information to the message. I have this custom view:

     

    let
        client_id = "xxxxxxxxx",
        client_secret = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
        corporation_host = "zzzzzzz",
     
        //do not edit section below
        base_url = "https://" & corporation_host & ".csod.com/services/api",
        token_url = base_url & "/oauth2/token",
        odata_url = base_url & "/x/odata/api/views/",
     
        query = [
            clientId = client_id,
            clientSecret = client_secret,
            grantType = "client_credentials",
            scope="all"
            ],
        oauthRequest = Json.FromValue(query),
        Response = Web.Contents(token_url, [
            Content = oauthRequest,
            Headers=[#"Content-type" = "application/json",#"Accept" = "application/json"], ManualStatusHandling = {400}
            ]
        ),
        Parts = Json.Document(Response),
        authToken = if (Record.HasFields(Parts, {"error", "error_description"})) then
                        error Error.Record(Parts[error], Parts[error_description], Parts)
                    else
                        "Bearer " & Parts[access_token],
     
        Source=OData.Feed(odata_url,[#"Authorization" = authToken],null),
        //end of do not edit section
        User_View = Source{[Name="vw_rpt_applicant",Signature="table"]}[Data]
    in
        User_View

     

    I get the error in line "Source=Odata..." with a message like "we were unable to authenticate you with the credentials provided. Try again".

     

    The "authToken line" is correct (I can see it reviewng the steps), and the scope to do the search inside "vw_rpt_applicant" table, but I don't know why I get the error (anonymous credentials).

     

    Thanks!

    JC

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Troubleshooting Tips

    1. sessionToken in the URL is case sensitive.

    2. Make sure the API and sessionToken are active and enabled via the Edge API page.

    3. If you get the error: "Expression.Error: The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Language, Cache-Control, If-Modified-Since, Referer" this means the OData authentication type is not set to Anonymous. To modify the setting, navigate to File > Options and settings > Data source settings. Find your data source URL from the list, click Edit, edit the credential type to be Anonymous, and click Done.  Try again.

    See if it will help:https://github.com/cornerstoneondemand/CSOD-Power-BI-Integration-Utility/blob/master/README.md