We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
This adds a feature to identify related items for a given item ID
Describe the solution you'd like
This is a draft! It does not handle pagination which should be handled!!!
#' Find Related Items #' #' @param x an object created with [`arc_open()`] #' @param direction default `"reverse"`. One of `"reverse"` or `"forward"` defining the direction of the relationship. #' @inheritParams add_item #' @references [`/relatedItems` API Doc](https://developers.arcgis.com/rest/users-groups-and-items/related-items.htm) related_items <- function( x, direction = c("reverse", "forward"), sort_order = c("asc", "desc"), host = arc_host(), token = Sys.getenv("ARCGIS_TOKEN") ) { # validate args .dir <- rlang::arg_match(direction) sort_order <- rlang::arg_match(sort_order) item_id <- x[["serviceItemId"]] # https://[root]/content/items/[itemID]/relatedItems req <- httr2::req_url_path_append( httr2::request(host), "sharing/rest/content/items", item_id, "relatedItems" ) req_body <- httr2::req_body_form( req, direction = .dir, sordOrder = sort_order, token = token, f = "json" ) # perform request resp <- httr2::req_perform(req_body) # parse body RcppSimdJson::fparse( httr2::resp_body_string(resp) ) }
Additional context
Need to migrate to httr2 v.1.0 first for pagination helpers.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
This adds a feature to identify related items for a given item ID
Describe the solution you'd like
This is a draft! It does not handle pagination which should be handled!!!
Additional context
Need to migrate to httr2 v.1.0 first for pagination helpers.
The text was updated successfully, but these errors were encountered: