Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jayhawk
Advocate I
Advocate I

Connect to API. Bearer Token

Hi

I am having a hard time connecting to data via API.  I am attempting pull out data from Samsara, https://www.samsara.com/api#. (the website is public info).  They use something called Bearer Token.  I have my token.  I have no issues making a call, and getting data via Terminal.  

Could someone please tell me the steps in connecting to an API in PowerBI, having to use the company issued Bearer Token they provide to you.  

 

The steps in PowerBI I took are....Get Data>Web.  Have been unsuccessful.  Please see pictures of the different things I have tried.  

2020-01-10 14_00_44-Untitled - Power BI Desktop.png2020-01-10 14_02_03-Untitled - Power BI Desktop.png2020-01-10 14_03_30-Untitled - Power BI Desktop.png2020-01-10 14_03_42-Untitled - Power BI Desktop.png

Thank you

25 REPLIES 25

Great.  Glad you're rolling.  Good luck, 

This thread was a game-changer for me, Samsara support has been absolutely no help.  @jayhawk  @Icey  curious if either of you have had luck putting a parameter on your Samsara feed using startMs and endMs?  I am getting real-time values but cannot figure out how to add a time range parameter to my query to allow me to get a range of values.  I tried adding 'https://api.samsara.com/v1/industrial/data/?startMs>1577858400 to pull all values since January 1, 2020 but I receive a data source error.

 

Most likely it is a problem with me, I am an accountant malpracticing as a programmer.

That API call would be this.... https://api.samsara.com/v1/industrial/data?startMs=1577858400000&endMs=1587099600000

I don't think you can use the < or > signs in an API call.  

startMs=1577858401000 would represent Jan 1, 2020

endMs=1587099601000 would represent Today,

in this example for a time range.  

I guess depending on how you  have your devices set up, you should get something back.  I didn't get any info back for ours.  

 

Yes...Samsara support is by far the worst.  I actually believe they just don't have the expertise who know things.   

Anonymous
Not applicable

Hi, I'll give Postman a try again today and let you know. 

I have used the same steps but i am unble to proceed anywhere.

Do i have to setup OAuth 2.0 for this in both samsara and powerbi


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.