Forum Discussion
Connecting an API to Power BI
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.
- TaylorN6 years ago
Helper I
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.
- dgarcia6 years agoRegular VisitorHi 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"
}
]
}- TaylorN6 years ago
Helper I
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.