Skip to content

LinkageAsUserApi

All URIs are relative to http://localhost

Method HTTP request Description
GetDataTypesAsUser GET /api/v1/as-user/data-types Lists all available data types.
GetDataTypesLinksAsUser GET /api/v1/as-user/data-types/links List all possible links between data types that match the specified criteria.
GetLinksByIdsAsUser POST /api/v1/as-user/links/get-batch Finds existing links by passing many IDs. Pagination goes through all links matched the criteria.
GetLinksByParamsAsUser GET /api/v1/as-user/links Finds existing links matching the specified criteria.

GetDataTypesAsUser

set[character] GetDataTypesAsUser()

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 <- LinkageAsUserApi$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$GetDataTypesAsUser(data_file = "result.txt")
result <- api_instance$GetDataTypesAsUser()
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. -

GetDataTypesLinksAsUser

set[SourceTypePair] GetDataTypesLinksAsUser(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 <- LinkageAsUserApi$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$GetDataTypesLinksAsUser(type = var_typedata_file = "result.txt")
result <- api_instance$GetDataTypesLinksAsUser(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. -

GetLinksByIdsAsUser

ListResponse GetLinksByIdsAsUser(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 <- LinkageAsUserApi$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$GetLinksByIdsAsUser(request = var_requestdata_file = "result.txt")
result <- api_instance$GetLinksByIdsAsUser(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. -

GetLinksByParamsAsUser

ListResponse GetLinksByParamsAsUser(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 <- LinkageAsUserApi$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$GetLinksByParamsAsUser(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$GetLinksByParamsAsUser(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. -