Hello,
I am working to use the Power Query function to bring Marketo lead data into Excel. I have the following code written and have attached a screenshot of the error I am getting. Has anybody used Power query to bring in lead details from Marketo and what is causing this error? Any advice on this would be great.
let
// Get url and credentials from config worksheet - Table REST_API_Authentication
mktoUrlStr = Excel.CurrentWorkbook(){[Name="REST_API_Authentication"]}[Content]{0}[URL],
clientIdStr = Excel.CurrentWorkbook(){[Name="REST_API_Authentication"]}[Content]{0}[Client ID],
clientSecretStr = Excel.CurrentWorkbook(){[Name="REST_API_Authentication"]}[Content]{0}[Client Secret],
// Calling Marketo API Get Access Token
getAccessTokenUrl = mktoUrlStr & "/identity/oauth/token?grant_type=client_credentials&client_id=" & clientIdStr & "&client_secret=" & clientSecretStr,
TokenJson = try Json.Document(Web.Contents(getAccessTokenUrl)) otherwise "Marketo REST API Authentication failed, please check your credentials",
// Parsing access token from Json
accessTokenStr = TokenJson[access_token]
in
accessTokenStr
Hey Sanford,
Thanks for the reply. I have updated the code with the Syntax highlighter. Let me know if that works
@jspain Can you show us the actual string that gets generated that you are using to make your call, and also the entire response body.