Forum Discussion
Setting up an Odata connection for Cornerstone API Reporting connector
- 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.
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