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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
dgarcia
Regular Visitor

Connecting an API to Power BI

Hello Everyone,

 

 

I'm having the hardest time connecting a  to PowerBI via API with a key. I'm not sure where to start I have zero experience with API.

 

While connecting the API I get an error for "A web API key can only be specified when a web API key name is provided" or AN API key value wasn't specified"

 

power bi 1.jpgpower bi 2.jpg

8 REPLIES 8
dgarcia
Regular Visitor

Hi @TaylorN ,

 

I just tried exactly what you posted below but I still can seem to get it to work. Any help would be greatly appreciated. 

 

 

 

Capture2.PNGCapture.PNG

@dgarcia 

That would mean that the data being returned isn't a webpage as you've specified (i.e. HTML tags etc.) Can you try using something like Postman to hit that API endpoint to see the data that you're getting back? 

 

Postman is pretty easy to use, and in my opinion, crucial when working with APIs. Just create a new GET request, type in that URL, click the "headers" tab, and add your API key, just as you've done in Power BI.

Hi @TaylorN ,


If it' helpful I provided the instructions that I'm supposed to use to create the API from the community OS system.


Search API Documentation
Authentication
Authentication is HTTP header-based, using the Authorization-Token header with the calling account's API key.
API keys can be generated here.
Compression
The deflate compression algorithm is supported. Send the "Accept-Encoding" header with the value "deflate" to enable.
REST Methods
Valid REST Methods: GET and POST
Limit
The "limit" parameter via GET or POST is supported in all REST methods. This parameter will restrict the number of rows returned by the API. This parameter must be greater than zero and less than or equal to 200. If no limit is provided the API will default to 200.
Offset
The "offset" parameter via GET or POST is supported in all REST methods. The offset will present the results offset by the integer provided. Using this parameter you can paginate the results from this api. Therefore a request may access any page (n) from this api by supplying an offset of n * limit + 1.
Order
The "order" parameter via GET or POST is supported in all REST methods. The order will present the results ordered by the given column or json array of columns.
JSON Format
All responses and posted values should be valid JSON within a key/value structure. Valid keys and data types on this API deployment:
{
"Client_CreateStamp": {
"value": "timestamp with time zone",
"operator": [
"date_greaterthan | date_lessthan | date_equals | greaterthan | lessthan | equals | minus_days_interval | minus_months_interval | minus_years_interval | plus_days_interval | plus_months_interval | plus_years_interval"
]
},
"Interaction_CreateStamp": {
"value": "timestamp with time zone",
"operator": [
"date_greaterthan | date_lessthan | date_equals | greaterthan | lessthan | equals | minus_days_interval | minus_months_interval | minus_years_interval | plus_days_interval | plus_months_interval | plus_years_interval"
]
},
"AssistanceSystem_AssistanceDate": {
"value": "timestamp with timezone (ISO, mdy)",
"operator": [
"equals | lessthan | greaterthan"
]
}
}

Example GET call:
curl \
"https://icfs.communityos.org/api/WoolseyFire" \
-X GET \
-H 'Authorization-Token: account_api_key'
Example POST call:
curl \
"https://icfs.communityos.org/api/WoolseyFire" \
-X POST \
-H "Content-Type: application/json" \
--data '{ \
"Client_CreateStamp": { \
"value": "timestamp with time zone", \
"operator": [ \
"date_greaterthan | date_lessthan | date_equals | greaterthan | lessthan | equals | minus_days_interval | minus_months_interval | minus_years_interval | plus_days_interval | plus_months_interval | plus_years_interval" \
] \
}, \
"Interaction_CreateStamp": { \
"value": "timestamp with time zone", \
"operator": [ \
"date_greaterthan | date_lessthan | date_equals | greaterthan | lessthan | equals | minus_days_interval | minus_months_interval | minus_years_interval | plus_days_interval | plus_months_interval | plus_years_interval" \
] \
}, \
"AssistanceSystem_AssistanceDate": { \
"value": "timestamp with timezone (ISO, mdy)", \
"operator": [ \
"equals | lessthan | greaterthan" \
] \
} \
}' \
-H 'Authorization-Token: account_api_key'
Example Result Object:
{
"result": "success",
"data": [
{
"Client_CreateStamp": "timestamp with timezone",
"Client_Id": "text",
"Client_CreateAccountId": "create account id",
"Client_CreateAccountId_HrefLabel": "account name and id",
"Client_CreatePortalId": "create portal id",
"Client_CreateFormsetDeploymentId": "create formset deployment id",
"Client_EditAccountId": "edit account id",
"Client_EditAccountId_HrefLabel": "account name and id",
"Client_EditPortalId": "edit portal id",
"Client_EditFormsetDeploymentId": "edit formset deployment id",
"Client_EditStamp": "timestamp with timezone",
"Client_AuditStamp": "timestamp with timezone",
"Client_Status": "status of record (active | deleted | archive)",
"ClientEvent_ClientEvent": "text",
"ClientUpload_PriorContactOrganizations": "text",
"ClientAccount_DcmAssignment": "text",
"ClientOption_PredisasterLivingSituationBestDescribedAs": "text",
"ClientOption_DcmpPriorityLevel": "text",
"ClientOption_PreferredLanguageOptionId": "text",
"ClientOrganization_CaseManagerOrganization": "text",
"ClientCustom_Veteran": "text",
"ClientAddressus_ClientAddressus": "text",
"ClientSystem_FirstName": "text",
"ClientSystem_LastName": "text",
"ClientSystem_DateOfBirth": "text",
"ClientSystem_SingleHeadOfHouseholdWithMinorsInHome": "text",
"ClientSystem_RecoveringFromPreviousDisaster": "text",
"ClientSystem_MemberWfunctionalAndAccessNeeds": "text",
"ClientSystem_LivingInUnsafeunsanitaryEnvironment": "text",
"ClientSystem_SufferedDamageAndIsUnderinsured": "text",
"ClientSystem_TotalNumberOfChildrenUnder18": "text",
"ClientSystem_TotalNumberOfAdults18OrOlder": "text",
"ClientSystem_IsolatedGeographicallySocially": "text",
"ClientSystem_HouseholdSignificantEmotionalDistress": "text",
"ClientSystem_HouseholdIncludesMembersAged65OrOlder": "text",
"ClientSystem_HouseholdWithMentalHealthNeeds": "text",
"ClientSystem_HouseholdWithMedicallyRelatedNeeds": "text",
"Interaction_CreateStamp": "timestamp with timezone",
"Interaction_ClientId": "text",
"Interaction_Id": "text",
"Interaction_CreateAccountId": "create account id",
"Interaction_CreateAccountId_HrefLabel": "account name and id",
"Interaction_CreatePortalId": "create portal id",
"Interaction_CreateFormsetDeploymentId": "create formset deployment id",
"Interaction_EditAccountId": "edit account id",
"Interaction_EditAccountId_HrefLabel": "account name and id",
"Interaction_EditPortalId": "edit portal id",
"Interaction_EditFormsetDeploymentId": "edit formset deployment id",
"Interaction_EditStamp": "timestamp with timezone",
"Interaction_AuditStamp": "timestamp with timezone",
"Interaction_Status": "status of record (active | deleted | archive)",
"Assistance_ClientId": "text",
"Assistance_Id": "text",
"Assistance_CreateAccountId": "create account id",
"Assistance_CreateAccountId_HrefLabel": "account name and id",
"Assistance_CreatePortalId": "create portal id",
"Assistance_CreateFormsetDeploymentId": "create formset deployment id",
"Assistance_EditAccountId": "edit account id",
"Assistance_EditAccountId_HrefLabel": "account name and id",
"Assistance_EditPortalId": "edit portal id",
"Assistance_EditFormsetDeploymentId": "edit formset deployment id",
"Assistance_CreateStamp": "timestamp with timezone",
"Assistance_EditStamp": "timestamp with timezone",
"Assistance_AuditStamp": "timestamp with timezone",
"Assistance_Status": "status of record (active | deleted | archive)",
"AssistanceOption_Organization": "text",
"AssistanceCustom_Notes": "text",
"AssistanceSystem_AssistanceDate": "text",
"AssistanceSystem_Value": "text"
}
]
}

Hi @dgarcia 

I still think you should run some HTTP requests via Postman to see how the data is being returned. Without having access to the API myself, I am afraid I can't help much more. Are you able to generate an API key for me to test with, that you can delete/change later?

 

It also appears that you're going to have to iterate over the data, as the documentation suggests there is pagination. I've found this article to be helpful in the past.

Hey ,

I tried it on Postman! Very easy to navigate once you get the hang of it. Thank you for the suggestion! It works fine with Postman and pulls all the information correct.

I just need to figure out how to do it in power bi for some reason I keep getting a different error now.

Details: "Block length does not match with its complement."

Also for some reason on the application we cannot delete our API keys yet but I requested to have a temporary API key to see if you might be able to help me troubleshoot. I think the problem is with power bi not being able to pull the information not with actual API. Or it's me not know what I'm doing!!

Hi, 

Any luck ? I am on the same stage now.  Please refer https://community.powerbi.com/t5/Desktop/PowerBI-Connection-to-Synergi-life-API/m-p/2297856#M832227

 

Got stuck on the authentication stage itself for the past 1 week. 

Hi @dgarcia 

That particular error relates to GZIP compression (from memory) and is a .NET exception. I'm not sure exactly how to fix it, but perhaps you could fiddle around with the "Content-Encoding" header on the HTTP request? i.e. set the Content-Encoding header to a value of gzip.

TaylorN
Helper I
Helper I

Hi @dgarcia 

 

Do you know how the API expects authentication to be passed? You should (hopefully) find this in the API documentation. It looks like you've tried to add some HTTP headers there, and that makes sense because many APIs expect a token/key to be provided as a header (i.e. X-API-Key etc.).

 

If it does indeed expect an API key via HTTP header, then you should be able to simply choose "Anonymous" authentication, and ensure that you specify the API key in the HTTP header value.

2020-04-24 07_57_35-Window.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors