Skip to content

LinkageAsCuratorApi

All URIs are relative to http://localhost

Method HTTP request Description
DeleteLinkAsCurator DELETE /api/v1/as-curator/links Deletes existing links matching the specified criteria.
GetDataTypesAsCurator GET /api/v1/as-curator/data-types Lists all available data types.
GetDataTypesLinksAsCurator GET /api/v1/as-curator/data-types/links List all possible links between data types that match the specified criteria.
GetLinksByIdsAsCurator POST /api/v1/as-curator/links/get-batch Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.
GetLinksByParamsAsCurator GET /api/v1/as-curator/links Finds existing links matching the specified criteria.
SaveLinksAsCurator POST /api/v1/as-curator/links Creates new links between objects.

DeleteLinkAsCurator

DeleteLinkAsCurator(first_id, second_id, first_type = var.first_type, second_type = var.second_type)

Deletes existing links matching the specified criteria.

This method should be used in case you want to delete the links of an object. Please, keep in mind that deleting a link between Study and Sample will not delete a link between corresponding Sample and it’s signal.

Example

library(odmApi)

# Deletes existing links matching the specified criteria.
#
# prepare function argument(s)
var_first_id <- "first_id_example" # character | Object ID (accession) (e.g. accession of study)
var_second_id <- "second_id_example" # character | Object ID (accession) (e.g. accession of study)
var_first_type <- "first_type_example" # character | Type of the object (e.g. study) (Optional)
var_second_type <- "second_type_example" # character | Type of the object (e.g. study) (Optional)

api_instance <- LinkageAsCuratorApi$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")
api_instance$DeleteLinkAsCurator(var_first_id, var_second_id, first_type = var_first_type, second_type = var_second_type)

Parameters

Name Type Description Notes
first_id character Object ID (accession) (e.g. accession of study)
second_id character Object ID (accession) (e.g. accession of study)
first_type character Type of the object (e.g. study) [optional]
second_type character Type of the object (e.g. study) [optional]

Return type

void (empty response body)

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Link has been successfully deleted. -
400 Invalid data in request. -
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 links were found. -
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. -

GetDataTypesAsCurator

set[character] GetDataTypesAsCurator()

Lists all available data types.

This endpoint is for instructional uses and can be used to get the latest list of Data Types.

Example

library(odmApi)

# Lists all available data types.
#

api_instance <- LinkageAsCuratorApi$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$GetDataTypesAsCurator(data_file = "result.txt")
result <- api_instance$GetDataTypesAsCurator()
dput(result)

Parameters

This endpoint does not need any parameter.

Return type

set[character]

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 The request was successful. The returned value is a list of objects. -
400 Entities cannot be retrieved. -
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). -
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. -

GetDataTypesLinksAsCurator

set[SourceTypePair] GetDataTypesLinksAsCurator(type = var.type)

List all possible links between data types that match the specified criteria.

This endpoint should be used for instructional needs, and can be used in order to get the links between the Data Types.

Example

library(odmApi)

# List all possible links between data types that match the specified criteria.
#
# prepare function argument(s)
var_type <- "type_example" # character | Return only links with the specified data type. (Optional)

api_instance <- LinkageAsCuratorApi$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$GetDataTypesLinksAsCurator(type = var_typedata_file = "result.txt")
result <- api_instance$GetDataTypesLinksAsCurator(type = var_type)
dput(result)

Parameters

Name Type Description Notes
type character Return only links with the specified data type. [optional]

Return type

set[SourceTypePair]

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 The request was successful. The returned value is a list of objects. -
400 Entities cannot be retrieved. -
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). -
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. -

GetLinksByIdsAsCurator

ListResponse GetLinksByIdsAsCurator(request = var.request)

Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.

Please make sure to use that endpoint for batch calls only. You are not allowed to pass 'mixed' objects. e.g. Studies and Samples at the same time. Please always specify firstType.

Example

library(odmApi)

# Finds existing links by passing many IDs.  Pagination goes through all links matched the criteria.
#
# prepare function argument(s)
var_request <- BatchOfIds$new("firstType_example", c("firstIds_example"), 123, 123) # BatchOfIds |  (Optional)

api_instance <- LinkageAsCuratorApi$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$GetLinksByIdsAsCurator(request = var_requestdata_file = "result.txt")
result <- api_instance$GetLinksByIdsAsCurator(request = var_request)
dput(result)

Parameters

Name Type Description Notes
request BatchOfIds [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
400 Entities cannot be retrieved. -
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). -
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. -

GetLinksByParamsAsCurator

ListResponse GetLinksByParamsAsCurator(first_id, first_type = var.first_type, second_id = var.second_id, second_type = var.second_type, offset = 0, limit = 1000)

Finds existing links matching the specified criteria.

Please make sure that this endpoint should be used only for getting all links to a specific object. In case you specify both firstId and secondId an expected answer would be true for existing links and false for no link between the objects.

Example

library(odmApi)

# Finds existing links matching the specified criteria.
#
# prepare function argument(s)
var_first_id <- "first_id_example" # character | Object ID (accession) (e.g. accession of study)
var_first_type <- "first_type_example" # character | Type of the object (e.g. study) (Optional)
var_second_id <- "second_id_example" # character | Object ID (accession) (e.g. accession of study) (Optional)
var_second_type <- "second_type_example" # character | Type of the object (e.g. study) (Optional)
var_offset <- 0 # integer | Param says to skip that many links before beginning to return links. (Optional)
var_limit <- 1000 # integer | Param says to limit the count of returned links. (Optional)

api_instance <- LinkageAsCuratorApi$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$GetLinksByParamsAsCurator(var_first_id, first_type = var_first_type, second_id = var_second_id, second_type = var_second_type, offset = var_offset, limit = var_limitdata_file = "result.txt")
result <- api_instance$GetLinksByParamsAsCurator(var_first_id, first_type = var_first_type, second_id = var_second_id, second_type = var_second_type, offset = var_offset, limit = var_limit)
dput(result)

Parameters

Name Type Description Notes
first_id character Object ID (accession) (e.g. accession of study)
first_type character Type of the object (e.g. study) [optional]
second_id character Object ID (accession) (e.g. accession of study) [optional]
second_type character Type of the object (e.g. study) [optional]
offset integer Param says to skip that many links before beginning to return links. [optional] [default to 0]
limit integer Param says to limit the count of returned links. [optional] [default to 1000]

Return type

ListResponse

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 The request was successful. The returned value is a list of objects. -
400 Entities cannot be retrieved. -
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). -
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. -

SaveLinksAsCurator

SaveLinksAsCurator(links = var.links)

Creates new links between objects.

This method should be used only in case you need to create links between 2 objects. Links are created both ways (e.g. when linking Object A to Object B it can be done both ways, by linking firstType to secondType and vice versa).

Example

library(odmApi)

# Creates new links between objects.
#
# prepare function argument(s)
var_links <- c(Link$new("firstId_example", "firstType_example", "secondId_example", "secondType_example")) # array[Link] |  (Optional)

api_instance <- LinkageAsCuratorApi$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")
api_instance$SaveLinksAsCurator(links = var_links)

Parameters

Name Type Description Notes
links list( Link ) [optional]

Return type

void (empty response body)

Authorization

Access-token, Genestack-API-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Links were updated or not modified. -
201 At least one new link has been created.Some other links might have been updated or not modified. -
400 Invalid data in request. -
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). -
409 Link cannot be created due to conflict with existing link -
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. -