API
How to use the Token-API of DataGym
Overview
With our REST-API you can easily manage your data within the DataGym application. This documentation will guide you through installation, setup and descriptions of each available endpoint.
Usage
To use the API you need a valid API token for your organisation.
You have two options to authenticate your application/call against our API.
Authorization header
Request parameter
Get All Projects
GET
https://app.datagym.ai/api/v1/project
This endpoint allows you to get all Projects for the organisation of your API token.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Get Dataset by Id
GET
https://app.datagym.ai/api/v1/dataset/{datasetId}
This endpoint allows you to get a Dataset by its Id.
Path Parameters
datasetId
string
The Id of the Dataset.
Query Parameters
token
string
Request param to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Get All Datasets
GET
https://app.datagym.ai/api/v1/dataset
This endpoint allows you to get all Datasets for the organisation of your API token.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Create Dataset
POST
https://app.datagym.ai/api/v1/dataset
This endpoint allows you to create a Dataset .
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Request Body
shortDescription
string
Short description of the Dataset.
name
string
The name of the Dataset.
Add Dataset to Project
POST
https://app.datagym.ai/api/v1/project/{projectId}/dataset/{datasetId}
This endpoint allows you to add a Dataset to a Project.
Path Parameters
datasetId
string
The Id of the Dataset.
projectId
string
The id of the Project.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Remove Dataset from Project
DELETE
https://app.datagym.ai/api/v1/project/{projectId}/dataset/{datasetId}/remove
This endpoint allows you to remove the connection between Dataset and Project. The Dataset won't be deleted from the database.
Path Parameters
datasetId
string
The Id of the Dataset.
projectId
string
The Id of the Project.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Create image (shareable link set)
POST
https://app.datagym.ai/api/v1/image/{datasetId}/url
This endpoint allows you to create several Images at the same time. Supported image mime types are: "image/jpeg" and "image/png"
Path Parameters
datasetId
string
The Id of the Dataset, in which you want to save your images.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Request Body
imageUrlSet
string
Collection of String's with the URL's of the Images, that you want to create.
Create image (local)
POST
https://app.datagym.ai/api/v1/image/{datasetId}/file
Upload a local image to the dataset.
Path Parameters
datasetId
string
The Id of the Dataset, in which you want to save your images.
Headers
X-filename
string
The specific image name.
Authorization
string
Authorization token to verify your request.
Request Body
object
The image file in the body (only one image in *.jpg, *.jpeg, and *.png format)
Download Image
GET
https://app.datagym.ai/api/v1/image/{imageId}
This endpoint allows you to download an Image. For video projects, a pre-signed temporary accessible URL will be returned to download the video.
Path Parameters
imageId
string
The Id of the Image, that you want to download.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Delete Image
DELETE
https://app.datagym.ai/api/v1/image/{imageId}
This endpoint allows you to delete an Image.
Path Parameters
imageId
string
The Id of the Image, that you want to delete.
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Export Labels
GET
https://app.datagym.ai/api/v1/export/{projectId}
This endpoint allows you to export the Labels from a Project.
Path Parameters
projectId
string
The Id of the Project
Query Parameters
token
string
Request parameter to verify your request.
Headers
Authorization
string
Authorization token to verify your request.
Import label
POST
https://app.datagym.ai/api/v1/project/{projectID}/prediction
Post your JSON formatted data to DataGym. The format of the prelabeled data is described in the description of Import Data under the Project documentation.
Path Parameters
projectId
string
The Id of the project.
Headers
Authorization
string
Authorization token to verify your request.
Request Body
payload
string
The prelabeled data.
Export segmentation bitmaps
GET
/api/v1/export/bitmap/{taskId}/{exportKey}
Streams the image segmentation bitmap.
Path Parameters
taskId
string
Id internally used by DataGym.ai
exportKey
string
The export key defined within your label configuration.
Clear Label Configuration
DELETE
https://app.datagym.ai/api/v1/config/{configId}
Deletes all Entries from the current Label Configuration. The Values, that are related to this Entries, will also be deleted. The Label Configuration Entity will NOT be deleted. The state of all Tasks with state ''COMPLETED' or 'REVIEWED' will be set to 'WAITING_CHANGED'.
Path Parameters
configId
string
The Id of the Label Configuration
Query Parameters
token
string
Request parameter to verify your request
Headers
Authorization
string
Authorization token to verify your request
Upload Label Configuration
PUT
https.//app.datagym.ai/api/v1/config/{configId}
This endpoint allows you to upload a Label Configuration. You need to clear your current Label Configuration first before you can upload the new Label Configuration.
Path Parameters
configId
string
The Id of the Label Configuration
Query Parameters
token
string
Request parameter to verify your request
Headers
Authorization
string
Authorization token to verify your request
Request Body
entries
string
List of all Entries from the new Label Configuration
The Body Parameter entries is a JSON Object with all Entries of the new Label Configuration. There are three required fields for all Entries (geometries and classifications):
entryKey
entryValue
type
Example: JSON with all geometries:
After the upload you will see the following Label Configuration for this Project:
Example: JSON with all classifications:
After the upload you will see the following Label Configuration for this Project:
You can combine and nest Geometries and Classifications to create your Label Configuration, for example:
Last updated