Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Power BI Service API authentication (Freshservice)

Hi all,

 

I'm pulling data from an API in an application called Freshservice (maybe there's someone out there using a similar source). In Desktop, it works perfectly, but I cannot get Service to authenticate.

 

This is my query source in Desktop:

 

Source = Csv.Document(Web.Contents("[API URL]", [Headers=[#"Content-Type"="application/csv", Authorization="Basic <[API key converted to Base64]>"]]),[Delimiter=",", QuoteStyle=QuoteStyle.Csv])

Authentication is built in and it works fine. A refresh in Service however always generates the same error:

"The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Range, Referer"

 

It will not accept Anonymous, nor will it accept any combination of API key, encoded API key, username/password for the application.  

 

I've been down many a rabbit hole on this one. Most people seem to have issues with the API url or pulling a limited number of records. None seem to differentiate between Desktop/Service. It's frustrating that one works and the other doesn't, but should Desktop be following a different method that allows Service to also connect?

  • Anonymous's avatar
    Anonymous
    6 years ago

    Apologies if this was in the wrong place. Since fixed though, so I haven't logged it as an issue. In summary:

    Through Power BI Desktop you can either set an authorisation header or specify Web API credentials to connect and pull data from Freshservice's API. Neither of these methods can be mirrored in Power BI Service; Web API cannot be set and it doesn't like the authorisation header being used.

     

    Instead, you can connect to the API URL and authorise using 'Basic'. Enter your normal credentials for Freshservice, not your API key. And by 'normal' I mean not your SSO credentials if you typically login with an organisational domain account.

    Power BI Service will pick up the API URL as a source and your normal credentials can be entered here too. So far, so good, automatic refreshing is working fine.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Apologies if this was in the wrong place. Since fixed though, so I haven't logged it as an issue. In summary:

    Through Power BI Desktop you can either set an authorisation header or specify Web API credentials to connect and pull data from Freshservice's API. Neither of these methods can be mirrored in Power BI Service; Web API cannot be set and it doesn't like the authorisation header being used.

     

    Instead, you can connect to the API URL and authorise using 'Basic'. Enter your normal credentials for Freshservice, not your API key. And by 'normal' I mean not your SSO credentials if you typically login with an organisational domain account.

    Power BI Service will pick up the API URL as a source and your normal credentials can be entered here too. So far, so good, automatic refreshing is working fine.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

       

      Anyway, is your problem be solved?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Yes, I'll accept my own response as the solution.

    • VinayanR's avatar
      VinayanR
      New Member

      Can you share the "Advanced Editor" code from powerquery that has worked for you. I am facing the same issue.