cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mparravani
Regular Visitor

Connect to Bamboo's REST API- Error"Web API key can only be specified when API key name is provided"

Hello,

 

I'm relatively new to PowerBI, and am trying to connect to Bamboo's Open API (REST API). 

 

My workflow is going through PowerBI's "New Source" --> "web" --> in "basic" I enter Bamboo's API URL (https://api.bamboohr.com/api/gateway.php/{company subdomain name}/)

 

Then at the Authentication window, I select Web API and input the API key I generated in Bamboo. Then I get an error "a web API key can only be specified when a web API key name is provided"

 

I've read around, and have seen that the api key name is required in Web.Content. But where / how do i enter this and what is the "api keyname"? Under "New Source" --> "web" --> there is an "advanced" option that has HTTP Request headers, but none of them are "web.content" or API keyname.

 

Any help or nudge in the right direction would be awesome.

 

Thanks,

-Mike

 

22 REPLIES 22
jalber
Helper I
Helper I

Here's how I connected to our BambooHR data:

 

1. <Optional> Create a service account in BambooHR and grant permissions to all the required fields for your query as well as the ability to create custom reports. Your service account will also need to have appropriate licensing in Office365.

2. Create a custom report in BambooHR with the fields required. Note the report ID at the end of the address when viewing the report.

3. Generate an API key in BambooHR. Make note of this API key because you will need it later.

4. Open Power BI and Get Data > Web > Address: https://api.bamboohr.com/api/gateway.php/companyDomain/v1/reports/id?format=csv (filling in the companyDomain and report ID with your data) > Username: <API key> > Password: <blank>

5. Create your visuals and publish your report to the Power BI service. 

6. Refresh your data. If prompted, update the credentials for BambooHR using the Username: <API key> and Password: x.

 

Good luck to you!

@jalber Thank you very much.


I managed to view the data but cannot refresh the data in the power bi service with basic authentification.

Tried "" and x as the password and it fails each time.

Please help.

Thanks.

Are you using a data gateway to connect to BambooHR's API? Are you able to refresh the data in PowerBI Desktop? Have you made any changes to the report you are using to fetch the data?

@jalber Hi 

I managed to get it to work by using the password "x" which is weird as I was using that the whole time.

I am able to refresh the data in power bi desktop and through the gateway now.

The struggle I have now is with getting photos which it is giving me back error 404.

I am trying to get back all employees photos with the URL below but fails:

https://api.bamboohr.com/api/gateway.php/Companydomain/v1/employees/id/photo/original

https://documentation.bamboohr.com/reference#photos-1

I don't have access to most things in Bamboo, so I can't be of much help. But I don't think you are able to use this call to receive *all* employees photos in one request. You have to identify in the string which employee ID you want to return. 

I see. Thanks for letting me know. I will reach out to them directly then to asssit

Thanks once again.

Domenick
Helper III
Helper III

Does anyone have any more guidance on how to get data through BambooHR's API into PowerBI? I don't have much experience using API requests, so I feel lost. I'm just looking to pull in a table of open positions in BambooHR and maybe also new/current employee details.

Jimmy801
Community Champion
Community Champion

Hello @Domenick 

 

normaly these sites have a help for developers where the specify the APIs available and how they work. Normaly different APIs are available, depending on witch data you need to get. And all of these APIs have different access modes and answers (that you need to do loops on the data, because normaly APIs are passing limited datasets).

 

Hope this helps a bit

 

Jimmy

Yes, @Jimmy801, I've found the documentation here, but it feels like there's a lot missing. They give basic guidelines about API calls, but I don't know all the paths I would need to pull the data I want.

Jimmy801
Community Champion
Community Champion

Hello @Domenick 

 

any news on this?

 

Jimmy

Thanks for asking @Jimmy801. I haven't made any progress because I'm still lost, i.e.:

- Where would I put a block of code that large when pulling data in PowerBI? And which language am I using?

- How do I learn all the field names and how the data is structured on BambooHR's end? Is it not set up as a relational database?

 

I'm planning to give this another good effort next week, but I need a break from spinning my wheels. Plus, I need to be able to show some sort of productivity here at work 😅

 

Jimmy801
Community Champion
Community Champion

Hello @Domenick 

 

the technical implementation description you can find here

https://documentation.bamboohr.com/reference 

 

I've created once a API. You can check it here, to get an idea how it could work

https://community.powerbi.com/t5/Power-Query/Configure-Web-Api-Connection-Several-Request/m-p/885727... 

 

Hope this helps a bit

 

Jimmy

kevinmcaloon
Frequent Visitor

I had the same issue initially but made it work by following these steps:

 

Using BASIC Authentification works!

Username - enter your [API Key]

Password - enter "x"

 

The url needs to be the full url that worked in your browser call; just remove the [API Key]:x@ from before api.bamboohr.com/api/...

 

So if original call used in web browser was:

https://[API Key]:x@api.bamboohr.com/api/gateway.php/[Company Name]/v1/employees/all/tables/jobInfo/

 

The url to enter in powerbi is:

https://api.bamboohr.com/api/gateway.php/[Company Name]/v1/employees/all/tables/jobInfo/

 

 

CarmenC
New Member

Hi,

I had the same error, so I used the following steps:

1. Get Data--> Web --> Basic URL (make sure you have the https:// format as Bamboo specifies)

2. Basic for access web content and add on user name the API key and at password a password that you want) and then connect

The connection works, but make sure you play with PowerBI edit queries (e.g. pivot columns, transpose, etc..) to setup the format of the data so it can be easily used.

 

Hope this helps.

 

 

 

gianfrancob
Frequent Visitor

Hello, I have the same problem and I don't seem to be able to get around it. 

 

Has anyone an idea how to connect to bambooHR's API?

 

I can do it via browser and with a python script just using my API key using the following format (in this case a report):

 

"https://[my API key ]:x@api.bamboohr.com/api/gateway.php/{my organisation subdomain}/v1/reports/{report ID}?format=JSON&fd=no"

 

but I don't seem to be able to replicate the same approach from powerbi.

 

Has anyone any suggestion?

 

THank you!

Managing to connect through web browser is great news.

 If "https://[my API key ]:x@api.bamboohr.com/api/gateway.php/{my organisation subdomain}/v1/reports/{report ID}?format=JSON&fd=no" works, it means that [my API key] is your username and x is your password. Try doing it in basic authentication.

 

If you want to use it in Power Query, follow my tutorial here. You can look up Authentication string in your web browser. It will be something like Authentiaction = "Basic <some long string here>".

 

Let me know, if you have any questions.

 

I had the similar issue, tried put the {API Key} in User Name and {x} in password still got "We Couldn't authenticate with the credentials provided."

 

 

I had the similar issue, tried put the {API Key} in User Name and {x} in password still got "We Couldn't authenticate with the credentials provided."

 

 

gianfrancob
Frequent Visitor

Hello, I have the same problem and I don't seem to be able to get around it. 

 

Has anyone an idea how to connect to bambooHR's API?

 

I can do it via browser and with a python script just using my API key using the following format (in this case a report):

 

"https://[my API key ]:x@api.bamboohr.com/api/gateway.php/{my organisation subdomain}/v1/reports/{report ID}?format=JSON&fd=no"

 

but I don't seem to be able to replicate the same approach from powerbi.

 

Has anyone any suggestion?

 

THank you!

WolfBiber
Microsoft
Microsoft

Hey,

API KEY  is not the right way here. 

Use Basic Authentication instead. 

Or if it a header parameter

let
Source= Json.Document(Web.Contents("https://api.bamboohr.com/api/gateway.php/{company subdomain name}/" , [Headers=[Authorization=YOURAPIKEY"]])),

 

Greetings

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!