Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Auto refresh data from API on web

Hi everyone!
As a newbie I'm trying to set an auto-update the API from a CRM service. I've found some tutorials here but no success. 
The API use a Header token. 

How can I add the API/token_name and token on the online dashboard for my client?

Thanks 🙂

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Done...I went to the dataset in PBI service online and set a auto refresh and worked ¬¬ haha
    Thanks guys!!

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the quick response!
      I'll try right now.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Pat...

       

      I didn't undertand. I've imported all the data thru Advanced Editor (before your solution):

      = Json.Document(Web.Contents("https://api.exactsales.com.br/v2/listarlead?max_results=10000", [Headers=[token_exact="my token"]]))

       

       

      I've followed your solution and gave me:

      = Json.Document(Web.Contents("https://api.exactsales.com.br/v2/" & "listarlead?max_results=10000", [Headers=[#"Content-Type"="application/json", token_exact="my token"]]))

       

      Basically the same. 

      This will auto refresh the report online? 

      I'm sorry, I'm newbie in this API field.

       

      Anyways, I've changed to the solution you gave, I'll publish now and pray for tomorrow auto-refresh 😄

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anyone? 😕

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    That probably won't solve it, but not that I see more info, I think you need a different fix.  Please see this post.

    The hidden gems of the function Web.Contents() - Kohera

    You likely need to pull the query part of your URL into the [query=  part of Web.Contents as described in that post.

     

    Also, you should be able to manually trigger refresh in the service to test if it is working or not (vs. waiting for the next scheduled refresh.

     

    Regards,

    Pat

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Done...I went to the dataset in PBI service online and set a auto refresh and worked ¬¬ haha
    Thanks guys!!