AnsweredAssumed Answered

How to connect excel with API?

Question asked by Ankit Dua on Feb 1, 2019
Latest reply on Feb 2, 2019 by Sanford Whiteman

I am trying to get the authentication token in excel and have used the following query:




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],


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",



accessTokenStr = TokenJson [access_token]





But everytime it throws an error



What should I do to fix this?