Skip to content

TasksAPIApi

All URIs are relative to http://localhost

Method HTTP request Description
GetTaskInfo GET /api/v1/tasks/{id} Retrieve information about any ODM task.
PublishAllStudies POST /api/v1/tasks/publish-versions Asynchronous task that publishes all pending versions across all studies in the instance.

GetTaskInfo

TaskInfo GetTaskInfo(id)

Retrieve information about any ODM task.

Supply the accession (id) of an ODM task to retrieve metadata about that task.

Example

library(odmApi)

# Retrieve information about any ODM task.
#
# prepare function argument(s)
var_id <- "id_example" # character | Accession of the task.

api_instance <- TasksAPIApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$GetTaskInfo(var_iddata_file = "result.txt")
result <- api_instance$GetTaskInfo(var_id)
dput(result)

Parameters

Name Type Description Notes
id character Accession of the task.

Return type

TaskInfo

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Task information. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
404 No object exists with the given ID. -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

PublishAllStudies

TaskInfo PublishAllStudies(version_message = var.version_message)

Asynchronous task that publishes all pending versions across all studies in the instance.

This endpoint publishes all information from drafts and creates new metadata versions for each study/associated objects with unpublished changes. Only curators with the ACCESS_ALL_DATA permission can use this method.

Example

library(odmApi)

# Asynchronous task that publishes all pending versions across all studies in the instance.
#
# prepare function argument(s)
var_version_message <- "version_message_example" # character | Supply text to name this version. If not supplied the version name is set to “Auto-published by API call” (Optional)

api_instance <- TasksAPIApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$PublishAllStudies(version_message = var_version_messagedata_file = "result.txt")
result <- api_instance$PublishAllStudies(version_message = var_version_message)
dput(result)

Parameters

Name Type Description Notes
version_message character Supply text to name this version. If not supplied the version name is set to “Auto-published by API call” [optional]

Return type

TaskInfo

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Task information. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
403 Forbidden -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -