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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Anonymous
Not applicable

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!

@Anonymous 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.

Anonymous
Not applicable

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?

@Anonymous 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

Anonymous
Not applicable

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 IV
Helper IV

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.

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.

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 😅

 

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
Employee
Employee

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors