GlobalFishingWatch / gfwr

R package for accessing data from Global Fishing Watch APIs
https://globalfishingwatch.github.io/gfwr/
Apache License 2.0
59 stars 7 forks source link

get_vessel_info() : `search_type = "advanced"` always cause error. #32

Closed teuder closed 2 years ago

teuder commented 2 years ago

When I specify search_type = "advanced" it always fails.

get_vessel_info(
  query = "shipname LIKE '%GABU REEFE%' OR imo = '8300949'",
  search_type ="advanced",
  dataset = "all",
  key = gfw_auth())

Error message.

Error in `resp_abort()`:
! HTTP 403 Forbidden.
* Not authorized by permissions
Backtrace:
 1. gfwr::get_vessel_info(...)
 6. httr2::req_perform(.)
 7. httr2:::resp_abort(resp, error_body(req, resp))
CianGFW commented 2 years ago

I got the same error message. get_raster() also fails with a similar error message (HTTP 401 instead of HTTP 403):

Error in `resp_abort()`:
! HTTP 401 Unauthorized.
Backtrace:
 1. gfwr::get_raster(...)
 6. httr2::req_perform(.)
 7. httr2:::resp_abort(resp, error_body(req, resp))
natemiller commented 2 years ago

@teuder Thank you. I'll check, but this is likely an API issue, rather than a gfwr error. I'll review and either correct it in gfwr or report the bug to the engineers.

natemiller commented 2 years ago

@teuder Can you reinstall the package and test this? I believe it should be fixed. If it is fixed can you close this issue or provide feedback if the problem remains.

Address with PR #39

teuder commented 2 years ago

@natemiller I confirmed the problem is fixed now.