New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Status 401; Unauthorized; No permission #157
Comments
I noticed that traffic flow API v6 is on maintenance. While they have API v7 for traffic flow. Looked like |
Thanks, I’ll check back next week if I see that v6 is back up and report back.On Jul 3, 2023, at 9:08 PM, said ***@***.***> wrote:
I noticed that traffic flow API v6 is on maintenance. While they have API v7 for traffic flow. Looked like hereR haven't used the API v7, have it?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thanks for reporting, the issue you're experiencing is likely caused by an invalid API key. Go to the projects view on HERE developer. Then create a new project and select REST. There you should be able to create an API key using the button “Create API key”. Copy paste the key and set it using # libraries
library(dplyr)
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
library(hereR)
# use a valid key
# set_key("<KEY>")
# print some logs
set_verbose(TRUE)
# health facility
data <- read.csv("https://raw.githubusercontent.com/isaid-hi/bipi.datalab/main/2023.06.24_%234%20Hospital%20Access/hospitals.csv")
# hospital only
hospitals <- data |> filter(Type %in% "Rumah Sakit")
hospital_sf <- st_as_sf(
x = hospitals,
coords = c("Longitude", "Latitude"),
crs = 4326
)
# isoline for hospitals
isochrones_all <- isoline(
poi = hospital_sf,
range = seq(10, 30, 10) * 60,
range_type = "time",
datetime <- as.POSIXct(paste0(Sys.Date(), " 10:00"))
)
#> Sending 2 request(s) with 1 RPS to: 'https://isoline.router.hereapi.com/v8/isolines?...'
#> Received 2 response(s) with total size: 11.7 Kb
# sort descending, convert units
isochrones_all <- isochrones_all |>
arrange(desc(range)) |>
mutate(name = paste0((range - 600) / 60, " to ", range / 60, " mins"))
isochrones_all
#> Simple feature collection with 6 features and 6 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 106.713 ymin: -6.876068 xmax: 106.9547 ymax: -6.421509
#> Geodetic CRS: WGS 84
#> id rank departure arrival range
#> 1 1 3 2023-07-04 10:00:00 2023-07-04 10:30:00 1800
#> 2 2 3 2023-07-04 10:00:00 2023-07-04 10:30:00 1800
#> 3 1 2 2023-07-04 10:00:00 2023-07-04 10:20:00 1200
#> 4 2 2 2023-07-04 10:00:00 2023-07-04 10:20:00 1200
#> 5 1 1 2023-07-04 10:00:00 2023-07-04 10:10:00 600
#> 6 2 1 2023-07-04 10:00:00 2023-07-04 10:10:00 600
#> geometry name
#> 1 POLYGON ((106.762 -6.558151... 20 to 30 mins
#> 2 POLYGON ((106.7142 -6.79332... 20 to 30 mins
#> 3 POLYGON ((106.7978 -6.73667... 10 to 20 mins
#> 4 POLYGON ((106.7334 -6.77410... 10 to 20 mins
#> 5 POLYGON ((106.8314 -6.60003... 0 to 10 mins
#> 6 POLYGON ((106.7639 -6.77581... 0 to 10 mins
mapview::mapview(isochrones_all, zcol = "name") I hope this helps? |
Thanks for the response. Actually this potential bug starts here in Posit Community. With the exact same API key,
it return error like this
|
Thanks. I think I may have gone off into the wilderness when creating the project because I never saw an API key option. I’ll report back.On Jul 4, 2023, at 4:31 AM, Merlin Unterfinger ***@***.***> wrote:
Thanks for reporting, the issue you're experiencing is likely caused by an invalid API key.
Go to the projects view on HERE developer. Then create a new project and select REST. There you should be able to create an API key using the button “Create API key”. Copy paste the key and set it using set_key(...). Or alternatively export it to the environment export HERE_API_KEY=<YOUR-VALID-KEY-HERE>.
# libraries
library(dplyr)
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
library(hereR)
# use a valid key
# set_key("<KEY>")
# print some logs
set_verbose(TRUE)
# health facility
data <- read.csv("https://raw.githubusercontent.com/isaid-hi/bipi.datalab/main/2023.06.24_%234%20Hospital%20Access/hospitals.csv")
# hospital only
hospitals <- data |> filter(Type %in% "Rumah Sakit")
hospital_sf <- st_as_sf(
x = hospitals,
coords = c("Longitude", "Latitude"),
crs = 4326
)
# isoline for hospitals
isochrones_all <- isoline(
poi = hospital_sf,
range = seq(10, 30, 10) * 60,
range_type = "time",
datetime <- as.POSIXct(paste0(Sys.Date(), " 10:00"))
)
#> Sending 2 request(s) with 1 RPS to: 'https://isoline.router.hereapi.com/v8/isolines?...'
#> Received 2 response(s) with total size: 11.7 Kb
# sort descending, convert units
isochrones_all <- isochrones_all |>
arrange(desc(range)) |>
mutate(name = paste0((range - 600) / 60, " to ", range / 60, " mins"))
isochrones_all
#> Simple feature collection with 6 features and 6 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 106.713 ymin: -6.876068 xmax: 106.9547 ymax: -6.421509
#> Geodetic CRS: WGS 84
#> id rank departure arrival range
#> 1 1 3 2023-07-04 10:00:00 2023-07-04 10:30:00 1800
#> 2 2 3 2023-07-04 10:00:00 2023-07-04 10:30:00 1800
#> 3 1 2 2023-07-04 10:00:00 2023-07-04 10:20:00 1200
#> 4 2 2 2023-07-04 10:00:00 2023-07-04 10:20:00 1200
#> 5 1 1 2023-07-04 10:00:00 2023-07-04 10:10:00 600
#> 6 2 1 2023-07-04 10:00:00 2023-07-04 10:10:00 600
#> geometry name
#> 1 POLYGON ((106.762 -6.558151... 20 to 30 mins
#> 2 POLYGON ((106.7142 -6.79332... 20 to 30 mins
#> 3 POLYGON ((106.7978 -6.73667... 10 to 20 mins
#> 4 POLYGON ((106.7334 -6.77410... 10 to 20 mins
#> 5 POLYGON ((106.8314 -6.60003... 0 to 10 mins
#> 6 POLYGON ((106.7639 -6.77581... 0 to 10 mins
mapview::mapview(isochrones_all, zcol = "name")
I hope this helps?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Still no success. The documents suggested that an API Access key, as opposed to an OA token would be available by signing up for fremium, and that created fremium app but still only the option to create an OA token, which doesn't work, But then it appears that applications needed to be migrated from the old deveoper.here.com to the new platform.here.com, which requires a separate account. And then after signing into the platform account links to documentation go back to the ifi. In any event, not one of the OA tokens work and there's a different way to create a different kind of token, called I'm sure that |
Sorry for the late reply, I was off some days. HERE has introduced the HERE Platform as a successor to HERE Developer. The process to create an API key has changed slightly and differs from the description in the hereR package vignette:
|
Describe the bug
here endpoint rejects API key
Unless I am wrong that the 'single-bearer credential' is the API key, authentication is consistently failing. If the API key is something other than here.access.key.id or here.access.key.secret, that's unclear in the example given. I've been unable to discover a third way of creating tokens on their developer website.
Reproducible example
Expected behavior
Following `set_key("some_token") request silently authenticates and returns results
Optionally: R session info
Not relevant
The text was updated successfully, but these errors were encountered: