Provides User Tokens for Access to ICES Web Services

Provides user tokens for ICES web services that require authentication and authorization. Web services covered by this package are ICES VMS database, the ICES DATSU web services, and the ICES SharePoint site < https://www.ices.dk/data/tools/Pages/WebServices.aspx>.


CRANStatus CRANMonthly CRANTotal License

ICES Logo

icesConnect

icesConnect provides GET, POST and PUT functions for users wishing to connect to ICES web services. The package provides the option to use tokens for ICES web services that require authentication and authorization.

icesConnect is implemented as an R package and available on CRAN.

Installation

icesConnect can be installed from CRAN using the install.packages command:

install.packages("icesConnect")

Usage

For a summary of the package:

library(icesConnect)
?icesConnect

Examples

To perform a normal get request:

ices_get_jwt("https://data.ices.dk/vms/api/gearwidths", jwt = "")
## GETing ... https://data.ices.dk/vms/api/gearwidths

## no token used

## OK (HTTP 200).

## Response [https://data.ices.dk/vms/api/gearwidths]
##   Date: 2026-10-20 19:37
##   Status: 200
##   Content-Type: application/json; charset=utf-8
##   Size: 3.72 kB

To perform a get request using a token, first get a token by logging in at https://data.ices.dk/token. The page shows R code to copy into your R session, which stores the token, for example:

set_token("<token copied from https://data.ices.dk/token>")

The token is then used for requests to ICES web services that need one:

ices_get_jwt("https://data.ices.dk/vms/api/gearwidths")

Tokens can not be refreshed from R. When a token has expired, the user is instructed to get a new one from https://data.ices.dk/token. To see who the stored token is for and when it expires:

decode_token()

Development

icesConnect is developed openly on GitHub.

Feel free to open an issue there if you encounter problems or have suggestions for future versions.

The current development version can be installed using:

# Download and install icesConnect in R
install.packages(
  "icesConnect",
  repos = c(
    icestoolsprod = "https://ices-tools-prod.r-universe.dev",
    CRAN = "https://cloud.r-project.org"
    )
)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.