Forum Discussion
Connecting to a local API via data gateway
- 3 years ago
Well, that's not really "local". How are you planning to do development work? Running Power BI Desktop on a VM that is in the same subnet?
Thanks - Can you give me a bit more info on how to do this please?
For this API - I will be passing a postcode as a query parameter and getting back coordinates info. The request looks like this: http://112.220.1.4:8000/postcodes/{postcode} and returns
{
"status": 200,
"result": {
"postcode": "L1 6DP",
"quality": 1,
"eastings": 334623,
"northings": 390674,
"country": "England",
"nhs_ha": "North West",
"longitude": -2.984936,
"latitude": 53.408811,
"european_electoral_region": "North West",
"primary_care_trust": "Liverpool",
"region": "North West",
"lsoa": "Liverpool 060E",
"msoa": "Liverpool 060",
"incode": "6DP",
"outcode": "L1",
"parliamentary_constituency": "Liverpool, Riverside",
"admin_district": "Liverpool",
"parish": "Liverpool, unparished area",
"admin_county": null,
"date_of_introduction": "198001",
"admin_ward": "Central",
"ced": null,
"ccg": "NHS Cheshire and Merseyside",
"nuts": "Liverpool",
"pfa": "Merseyside",
"codes": {
"admin_district": "E08000012",
"admin_county": "E99999999",
"admin_ward": "E05000889",
"parish": "E43000166",
"parliamentary_constituency": "E14000793",
"ccg": "E38000101",
"ccg_id": "99A",
"ced": "E99999999",
"nuts": "TLD72",
"lsoa": "E01033762",
"msoa": "E02006932",
"lau2": "E08000012",
"pfa": "E23000004"
}
}
}
Ideally - I will be going through a list of data with postcodes and geting back the lat long for each row, so I think will have set up as a function.
use http://112.220.1.4:8000/postcodes/
as the base URL and then provide the dynamic part (the post code) in the RelativePath portion.
- stevemccall13 years agoFrequent Visitor
Hi,
I just get this error:
How do I get PowerQuery to use the data dateway? The API is only accessible via the gateway.
For reference - this works fine if I go to a web API
But I'm unable to use that API for my solution.- lbendlin3 years agoSuper User
Sorry, I had assumed that you had already set up the gateway. It is always required for on-premise data sources.
- stevemccall13 years agoFrequent Visitor
Yes - the gateway is set up and works fine when accessing via powerapps, but I don't know how to access using PowerBI.