TCP API - OpenAPI 3.0 (v1)

Download OpenAPI specification:Download

Welcome to TheCrossProduct's Web API documentation. Our API is based on REST principles and all requests are made to endpoints beginning with https://api.thecrossproduct.xyz/v1 and JSON objects are returned. All API requests must be made over a secure https connection.

Our API provides access to account and license information, as well as the ability to request runs from TheCrossProduct's solutions.

Some useful links:

Authentication

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

BearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

login

Please login with Basic authentication to acquire a JWT token (BearerAuth)

/auth/login

Use this endpoint with Basic authentication to acquire a JWT token

There is a limited number of tokens that can simultaneously be active. The default limit is 50. If you need more, please contact us at contact@thecrossproduct.com.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "token": "string"
}

data

Operations on your data stored at TheCrossProduct's storage

/data

Use this endpoint to list your personal data and your groups' data.

Use a POST request to filter result.

By default, this endpoints will list you at most 100 files or directories in alphanumerical order. Keep in minds that if 'dirs' has lesser than 100 elements, it does not mean that there is no more directory in the current search.

You can use 'prefix' or 'suffix' to narrow your results. They either take a string or a list of uris. Remember that uris for folders end with '/' unlike files. Thus, if you want to list the content of a folder, you should use the following (notice the '/' at the end):

client.query().data.post({"prefix":"path/to/folder/"})

The following will list you all the files that starts with 'some_prefix_' in folder 'path/to/':

client.query().data.post({"prefix":"path/to/some_prefix_"})

You can also generate a topdown search of your data hierarchy by using the option 'hierarchy'. It has to be used in conjonction with prefix.

client.query().data.post({"hierarchy": True})

{"paging":..., "files":[], "dirs":["dirA/", "dirB/"]} client.query().data.post({"hierarchy": True, "prefix":"dirA/"}) {"paging":..., "files":[], "dirs":["dirA/some_sub_dir"]}

By default, this requests show only personal file. To reach group files, you will have to use 'group'. This option take an array of group names or ids. You will want to exclude personal file by setting 'personal' to False. You can list the groups that you are subscribed to by using the following request:

client;query().auth.get()

Authorizations:

Responses

Response samples

Content type
application/json
{}

/data

Use this endpoint to list your personal data and your groups' data.

Use a POST request to filter result.

By default, this endpoints will list you at most 100 files or directories in alphanumerical order. Keep in minds that if 'dirs' has lesser than 100 elements, it does not mean that there is no more directory in the current search.

You can use 'prefix' or 'suffix' to narrow your results. They either take a string or a list of uris. Remember that uris for folders end with '/' unlike files. Thus, if you want to list the content of a folder, you should use the following (notice the '/' at the end):

client.query().data.post({"prefix":"path/to/folder/"})

The following will list you all the files that starts with 'some_prefix_' in folder 'path/to/':

client.query().data.post({"prefix":"path/to/some_prefix_"})

You can also generate a topdown search of your data hierarchy by using the option 'hierarchy'. It has to be used in conjonction with prefix.

client.query().data.post({"hierarchy": True})

{"paging":..., "files":[], "dirs":["dirA/", "dirB/"]} client.query().data.post({"hierarchy": True, "prefix":"dirA/"}) {"paging":..., "files":[], "dirs":["dirA/some_sub_dir"]}

By default, this requests show only personal file. To reach group files, you will have to use 'group'. This option take an array of group names or ids. You will want to exclude personal file by setting 'personal' to False. You can list the groups that you are subscribed to by using the following request:

client;query().auth.get()

Authorizations:
Request Body schema: application/json
expands_info
boolean or null

display more information for each file (verbose).

group
string or null

show file of specified group

groups
Array of strings or null

show file from specified groups

hierarchy
boolean or null

display one level of the file hierarchy (by defaut false)

ignores
Array of strings or null

list of fields to ignore in the response. Only if expands_info is set.

items_per_page
integer or null

by default 100

personal
boolean or null

show personal file (by default true)

prefix
Array of strings or null
since
string or null <date-time>
suffix
Array of strings or null

Responses

Request samples

Content type
application/json
{
  • "expands_info": true,
  • "group": "string",
  • "groups": [
    ],
  • "hierarchy": true,
  • "ignores": [
    ],
  • "items_per_page": 0,
  • "personal": true,
  • "prefix": [
    ],
  • "since": "2019-08-24T14:15:22Z",
  • "suffix": [
    ]
}

Response samples

Content type
application/json
{}

/data/copy

Use this endpoint to copy a file.

Authorizations:
Request Body schema: application/json
dest
required
string

path to TCP storage

merge
boolean or null

by default True

overwrite
boolean or null

by default False

src
required
string

path to TCP storage

Responses

Request samples

Content type
application/json
{
  • "dest": "string",
  • "merge": true,
  • "overwrite": true,
  • "src": "string"
}

/data/dir

Use this endpoint to create directory on your TCP storage.

Authorizations:
Request Body schema: application/json
uri
required
string

path to TCP storage

Responses

Request samples

Content type
application/json
{
  • "uri": "string"
}

/data/download

Get a temporary link to download data from TCP storage

Authorizations:
Request Body schema: application/json
uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "uri": "string"
}

Response samples

Content type
application/json

/data/exists

Use this endpoint to check if a file exists on your TCP storage.

Authorizations:
Request Body schema: application/json
uri
required
string

path to TCP storage

Responses

Request samples

Content type
application/json
{
  • "uri": "string"
}

/data/move

Use this endpoint to move a file.

Authorizations:
Request Body schema: application/json
dest
required
string

path to TCP storage

keep_original
boolean or null

by default False

merge
boolean or null

by default True. If dest is a dir, merge. If dest is a file, NOP

overwrite
boolean or null

by default False

src
required
string

path to TCP storage

Responses

Request samples

Content type
application/json
{
  • "dest": "string",
  • "keep_original": true,
  • "merge": true,
  • "overwrite": true,
  • "src": "string"
}

/data/remove

Use this endpoint to delete items from TCP storage

Authorizations:
Request Body schema: application/json
uri
required
string <uri>

path to TCP storage

Responses

Request samples

Content type
application/json

/data/upload/multipart

You can upload files using this endpoint. This is a three-steps process:

  1. Send a POST request to this endpoint obtain a list of short-lived URLs.
  2. Split the file into equally sized parts and send each part with a PUT request using the URLs from the previous step.
  3. Once all parts are sent, notify the server that the transaction is complete by send a POST request to https://api.thecrossproduct.xyz/v1/data/upload/multipart/complete

This endpoint performs the first step. You have to provide the target path in our storage and its size. The size is to be provided as an integer (number of bytes). You can also provide a desired number of parts. If you do not, it will be automatically computed.

This endpoint can be used to process multiple files at once by passing arrays in the JSON body.

Authorizations:
Request Body schema: application/json
One of
(integer or null) or (string or null)

bytes or human format

required
integer or string

bytes or human format (eg. "10Gb")

uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "part_size": [
    ],
  • "size": [
    ],
  • "uri": [
    ]
}

Response samples

Content type
application/json
{
  • "uploads": [
    ]
}

/data/upload/multipart/abort

You will have to this endpoint to abort an on-going upload.

A multipart upload is composed of the following 3 steps:

  1. Send a POST request to obtain a list of short-lived URLs.
  2. Split the file into equally size parts and send each part with a PUT request using the URLs from the previous step.
  3. Once all parts are sent, notify the server that the transaction is complete by send a POST request to https://api.thecrossproduct.xyz/v1/data/complete_multipart_post

If any individual part upload of step 2 fails, this request should be used to abort the upload.

You have to provide the upload id that you obtained from the first step. You have to provide the target path (field 'uri' in the JSON body).

Authorizations:
Request Body schema: application/json
One of
upload_id
required
string
uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "upload_id": [
    ],
  • "uri": [
    ]
}

Response samples

Content type
text/plain
Example
"Missing API token"

/data/upload/multipart/complete

You will have to this endpoint to terminate an on-going upload. This is the last step of the following three-steps process:

  1. Send a POST request to obtain a list of short-lived URLs.
  2. Split the file into equally sized parts and send each part with a PUT request using the URLs from the previous step.
  3. Once all parts are sent, notify the server that the transaction is complete by send a POST request to https://api.thecrossproduct.xyz/v1/data/upload/multipart/complete

You have to provide the upload id that you obtained from the first step. You have to provide the target path (field 'uri' in the JSON body). The field 'parts' is an array. For each element, you will have to provide 'ETag' (given by step 2) and 'PartNumber'.

This endpoint can be used to process multiple files at once by passing arrays in the JSON body.

Authorizations:
Request Body schema: application/json
One of
md5sum
string or null

if present, it will be used to assess the integrity of the file during download phase.

required
Array of objects
upload_id
required
string
uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "md5sum": [
    ],
  • "parts": [
    ],
  • "upload_id": [
    ],
  • "uri": [
    ]
}

Response samples

Content type
text/plain
Example
"Missing API token"

/data/upload/singlepart

You can upload files up to 5Gb in size using this endpoint. This is a three-steps process:

  1. Send a POST request to obtain a short-lived URL
  2. Make a PUT request to this URL with the content of the file in the request body
  3. Send a POST request to signal the completion of the upload.

This endpoint provide a temporary link to upload data to TCP storage. You have to provide the target path in our storage and its size. The size is to be provided as an integer (number of bytes).

It is recommanded to use the https://api.thecrossproduct.xyz/v1/data/upload/multipart as it works for any size of file.

Authorizations:
Request Body schema: application/json
uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "uri": "string"
}

Response samples

Content type
application/json

/data/upload/singlepart/complete

You will have to use this endpoint to terminate an on-going upload. This is the last step of the following tree-steps process:

  1. Send a POST request to obtain a short-lived URL
  2. Make a PUT request to this URL with the content of the file in the request body
  3. Send a POST request to signal the completion of the upload.

You have to provide the target path (field 'uri' in the JSON body).

This endpoint can be used to process multiple files at once by passing arrays in the JSON body.

Authorizations:
Request Body schema: application/json
One of
md5sum
string or null

if present, it will be used to assess the integrity of the file during download phase.

uri
required
string

path to S3

Responses

Request samples

Content type
application/json
{
  • "md5sum": [
    ],
  • "uri": [
    ]
}

Response samples

Content type
text/plain
Example
"Missing API token"

auth

Account-related queries

/auth

This endpoint provides informations about your account

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "created_on": "2019-08-24T14:15:22Z",
  • "group": [
    ],
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "last_activation": "2019-08-24T14:15:22Z",
  • "mail": "string",
  • "nbr_activations": 0
}

/auth/logout

The token used in the Authorization header will no longer be valid

Authorizations:

Responses

/auth/reset_password

Send a mail to the user to reset his password

Authorizations:
Request Body schema: application/json
mail
required
string

Responses

Request samples

Content type
application/json
{
  • "mail": "string"
}

Response samples

Content type
application/json
{}

/auth/token

This endpoint verifies the validity of your JWT token and provide its informations

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "expires_at": "2019-08-24T14:15:22Z",
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "limit": 0,
  • "scope": "string",
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  • "uses": 0
}

/auth/tokens

This endpoint deletes all active JWT tokens.

Authorizations:

Responses

app

Manage runs from TheCrossProduct's solutions

/app

Use this endpoint to list the applications, that you have a license for

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "domain": [
    ]
}

/app/process/outputs/{process_id}

Get a paginated list of outputs of a given process.

If you uses a POST request, you can set the number of entries per page and apply filters.

Authorizations:
path Parameters
process_id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "outputs": [
    ],
  • "paging": {}
}

/app/process/outputs/{process_id}

Get a paginated list of outputs of a given process.

If you uses a POST request, you can set the number of entries per page and apply filters.

Authorizations:
path Parameters
process_id
required
string <uuid>
Request Body schema: application/json
expired
boolean or null
ignores
Array of strings or null

list of fields to ignore in the response

items_per_page
integer or null
key
string or null
key_contains
string or null
key_endswith
string or null
key_startswith
string or null
refresh
boolean or null

By defaults, True

Responses

Request samples

Content type
application/json
{
  • "expired": true,
  • "ignores": [
    ],
  • "items_per_page": 0,
  • "key": "string",
  • "key_contains": "string",
  • "key_endswith": "string",
  • "key_startswith": "string",
  • "refresh": true
}

Response samples

Content type
application/json
{
  • "outputs": [
    ],
  • "paging": {}
}

/app/process/{process_id}

This endpoint forces the termination of your process and remove from the database if specified.

Authorizations:
path Parameters
process_id
required
string

uuid4, or multiple uuid4 separated by commas.

query Parameters
keep
boolean

set to (false|true). by default, false

Responses

/app/process/{process_id}

This endpoint provides the status of a process.

Authorizations:
path Parameters
process_id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "app": "string",
  • "domain": "string",
  • "endpoint": "string",
  • "errors": "string",
  • "expires": "2019-08-24T14:15:22Z",
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "launched": "2019-08-24T14:15:22Z",
  • "quote": 0,
  • "state": "string",
  • "terminated": "2019-08-24T14:15:22Z"
}

/app/processes

This endpoint forces the termination of all of your processes and removes all from the database if specified.

Authorizations:
query Parameters
keep
boolean

set to (false|true). by default, false

Responses

/app/processes

Get a paginated list of processes.

A process is the model for all on-going computation. A process orchestrates multiple instances.

If you uses a POST request, you can set the number of entries per page and apply filters.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "paging": {},
  • "processes": [
    ]
}

/app/processes

Get a paginated list of processes.

A process is the model for all on-going computation. A process orchestrates multiple instances.

If you uses a POST request, you can set the number of entries per page and apply filters.

Authorizations:
Request Body schema: application/json
agent
string or null
app
string or null
domain
string or null
endpoint
string or null
ignores
Array of strings or null

list of fields to ignore in the response

items_per_page
integer or null
since
string or null <date-time>
state
string or null
state_contains
string or null
tags_intersects
Array of strings or null
until
string or null <date-time>

Responses

Request samples

Content type
application/json
{
  • "agent": "string",
  • "app": "string",
  • "domain": "string",
  • "endpoint": "string",
  • "ignores": [
    ],
  • "items_per_page": 0,
  • "since": "2019-08-24T14:15:22Z",
  • "state": "string",
  • "state_contains": "string",
  • "tags_intersects": [
    ],
  • "until": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "paging": {},
  • "processes": [
    ]
}

lics

License-related queries

/lics/license/{token}

Get the info of a license

Authorizations:
path Parameters
token
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "active": true,
  • "created": "2019-08-24T14:15:22Z",
  • "failed_attempts": 0,
  • "last_failed": "2019-08-24T14:15:22Z",
  • "last_used": "2019-08-24T14:15:22Z",
  • "limit": 0,
  • "name": "string",
  • "scope": [
    ],
  • "token": "b5507016-7da2-4777-a161-1e8042a6a377",
  • "until": "2019-08-24T14:15:22Z",
  • "uses": 0
}

/lics/licenses

Get a paginated list of licenses

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "licenses": [
    ],
  • "paging": {}
}

/lics/licenses

Get a paginated list of licenses

Authorizations:
Request Body schema: application/json
active
boolean or null
failed_attempts
integer or null
failed_attempts_grt
integer or null
failed_attempts_lt
integer or null
ignores
Array of strings or null

list of fields to ignore in the response

items_per_page
integer or null
last_used_after
string or null <date-time>
last_used_before
string or null <date-time>
limit
number or null
limit_grt
number or null
limit_lt
number or null
name
string or null
name_contains
string or null
nb_activations
integer or null
nb_activations_grt
integer or null
nb_activations_lt
integer or null
scope
Array of strings or null
since
string or null <date-time>
until
string or null <date-time>
uses
number or null
uses_grt
number or null
uses_lt
number or null

Responses

Request samples

Content type
application/json
{
  • "active": true,
  • "failed_attempts": 0,
  • "failed_attempts_grt": 0,
  • "failed_attempts_lt": 0,
  • "ignores": [
    ],
  • "items_per_page": 0,
  • "last_used_after": "2019-08-24T14:15:22Z",
  • "last_used_before": "2019-08-24T14:15:22Z",
  • "limit": 0,
  • "limit_grt": 0,
  • "limit_lt": 0,
  • "name": "string",
  • "name_contains": "string",
  • "nb_activations": 0,
  • "nb_activations_grt": 0,
  • "nb_activations_lt": 0,
  • "scope": [
    ],
  • "since": "2019-08-24T14:15:22Z",
  • "until": "2019-08-24T14:15:22Z",
  • "uses": 0,
  • "uses_grt": 0,
  • "uses_lt": 0
}

Response samples

Content type
application/json
{
  • "licenses": [
    ],
  • "paging": {}
}

sncf_reseau

/app/sncf_reseau/railway_track_regression/run

Specs to compute a regression on a pair of rails generating an Alignment Geometry

This endpoint is used to initiate a process for sncf_reseau@railway_track_regression.

Upon successful initiation, an uuid4 is returned to you. This id will be used in subsequent requests to check the status of the process and retrieve the results.
Authorizations:
Request Body schema: application/json
required
object
output-prefix
string or null
tags
Array of strings or null

Responses

Request samples

Content type
application/json
{
  • "inputs": {
    },
  • "output-prefix": "string",
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}