get_export_status: Check the status of an export request from Go.Data (version...

View source: R/get_export_status.R

get_export_statusR Documentation

Check the status of an export request from Go.Data (version 2.38.1 or later)

Description

A function to check the status of an export request. This is a housekeeping function used in many of the other godataR functions.

Usage

get_export_status(url, username, password, request_id)

Arguments

url

Insert the base URL for your instance of Go.Data here. Don't forget the forward slash "/" at end!

username

The email address for your Go.Data login.

password

The password for your Go.Data login

request_id

The id number for the export request.

Value

Returns the current status of the export request.

Examples

## Not run: 
url <- "https://MyGoDataServer.com/"
username <- "myemail@email.com"
password <- "mypassword"
outbreak_id <- "3b5554d7-2c19-41d0-b9af-475ad25a382b"
access_token <- get_access_token(
  url = url,
  username = username,
  password = password
)

# Submit an export request
export_request <- GET(
  paste0(
    url,
    "api/outbreaks/",
    outbreak_id,
    "/cases/export",
    "&access_token=",
    access_token
  )
)
request_id <- content(export_request)
request_id <- pluck(request_id, "exportLogId")

# Check the status of the export request

export_request_status <- get_export_status(
  url = url,
  username = username,
  password = password,
  request_id = request_id
)

## End(Not run)

WorldHealthOrganization/godataR documentation built on May 21, 2023, 11:30 a.m.