Computation API
Prerequisites
Token with capsule scope
The computation ID to pass to the API call
The computation ID can only be accessed from the response from the API calls. A typical use cases are to use List capsule computations API to locate the computation ID from a capsule or Run capsule API to start a new computation. Both of the methods will have the computations ID in the response body that can use in computations API for further tracking and getting the results.
Get computation API
GET
https://{domain}codeocean.com/api/v1/computations/{computations_id}
Path Parameters
Name | Type | Description |
---|---|---|
{domain}* | String | Your VPC domain |
{computations_id}* | String | Computation's id |
Headers
Name | Type | Description |
---|---|---|
Content-Type* | String | application/json |
-u* | String | \ '${API Token from Code Ocean}:\' \ |
List computation result files API
POST
https://{domain}codeocean.com/api/v1/computations/{computations_id}/results
Path Parameters
Name | Type | Description |
---|---|---|
{domain}* | String | Your VPC domain |
{computations_id}* | String | Computation's id |
Headers
Name | Type | Description |
---|---|---|
Content-Type* | String | application/json |
-u* | String | \ '${API Token from Code Ocean}:\' \ |
Request Body
Name | Type | Description |
---|---|---|
path* | String | string - the path of the folder. The empty path will retrieve the result root folder. |
Get result file download URL API
GET
https://{domain}codeocean.com/api/v1/computations/{computations_id}/results/download_url?path={PATH_TO_FILE}
Path Parameters
Name | Type | Description |
---|---|---|
{domain}* | String | Your VPC domain |
{computations_id}* | String | Computation's id |
{PATH_TO_FILE}* | String | path of the file under /results |
Headers
Name | Type | Description |
---|---|---|
Content-Type* | String | application/json |
-u* | String | \ '${API Token from Code Ocean}:\' \ |
You can use List computation result files API to find the path of the file.
Last updated