DataGym.ai
Search…
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
1
"Authorization": "Token <your_DataGym_API_token>"
Copied!
  • Request parameter
1
https://app.datagym.ai/api/v1/project?token=<your_DataGym_API_token>
Copied!
get
https://app.datagym.ai
/api/v1/project
Get All Projects
get
https://app.datagym.ai
/api/v1/dataset/{datasetId}
Get Dataset by Id
get
https://app.datagym.ai
/api/v1/dataset
Get All Datasets
post
https://app.datagym.ai
/api/v1/dataset
Create Dataset
post
https://app.datagym.ai
/api/v1/project/{projectId}/dataset/{datasetId}
Add Dataset to Project
delete
https://app.datagym.ai
/api/v1/project/{projectId}/dataset/{datasetId}/remove
Remove Dataset from Project
post
https://app.datagym.ai
/api/v1/image/{datasetId}/file
Create image (local)
get
https://app.datagym.ai
/api/v1/image/{imageId}
Download Image
delete
https://app.datagym.ai
/api/v1/image/{imageId}
Delete Image
get
https://app.datagym.ai
/api/v1/export/{projectId}
Export Labels
post
https://app.datagym.ai
/api/v1/project/{projectID}/prediction
Import label
get
/api/v1/export/bitmap/{taskId}/{exportKey}
Export segmentation bitmaps
delete
https://app.datagym.ai
/api/v1/config/{configId}
Clear Label Configuration
put
https.//app.datagym.ai
/api/v1/config/{configId}
Upload 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:
1
[
2
{
3
"entryKey": "linekey",
4
"entryValue": "LineValue",
5
"type": "line",
6
"color": "green",
7
"shortcut": "1",
8
"children": []
9
},
10
{
11
"entryKey": "pointkey",
12
"entryValue": "PointValue",
13
"type": "point",
14
"color": "red",
15
"shortcut": "3",
16
"children": []
17
},
18
{
19
"entryKey": "polygonkey",
20
"entryValue": "PolyValue",
21
"type": "polygon",
22
"color": "blue",
23
"shortcut": "5",
24
"children": []
25
},
26
{
27
"entryKey": "rectanglekey",
28
"entryValue": "RectValue",
29
"type": "rectangle",
30
"color": "black",
31
"shortcut": "8",
32
"children": []
33
}
34
]
Copied!
After the upload you will see the following Label Configuration for this Project:
Label Configuration
Example: JSON with all classifications:
1
[
2
{
3
"entryKey": "checklistkey",
4
"entryValue": "CheckValue",
5
"type": "checklist",
6
"required": true,
7
"options": {
8
"firstCheckListOptionKey": "firstCheckListOptionValue",
9
"secondCheckListOptionKey": "secondCheckListOptionValue",
10
"thirdCheckListOptionKey": "thirdCheckListOptionValue"
11
},
12
"children": []
13
},
14
{
15
"entryKey": "freetextkey",
16
"entryValue": "FreeTextValue",
17
"type": "freetext",
18
"required": false,
19
"maxLength": 15,
20
"children": []
21
},
22
{
23
"entryKey": "selectkey",
24
"entryValue": "SelectValue",
25
"type": "select",
26
"required": false,
27
"options": {
28
"firstSelectOptionKey": "firstSelectOptionValue",
29
"secondSelectOptionKey": "secondSelectOptionValue",
30
"thirdSelectOptionKey": "thirdSelectOptionValue"
31
},
32
"children": []
33
}
34
]
Copied!
After the upload you will see the following Label Configuration for this Project:
Label Configuration
You can combine and nest Geometries and Classifications to create your Label Configuration, for example:
1
[
2
{
3
"entryKey": "linekey",
4
"entryValue": "LineValue",
5
"type": "line",
6
"color": "green",
7
"shortcut": "1",
8
"children": [
9
{
10
"entryKey": "checklistkey",
11
"entryValue": "CheckValue",
12
"type": "checklist",
13
"required": true,
14
"options": {
15
"firstCheckListOptionKey": "firstCheckListOptionValue",
16
"secondCheckListOptionKey": "secondCheckListOptionValue",
17
"thirdCheckListOptionKey": "thirdCheckListOptionValue"
18
},
19
"children": [
20
{
21
"entryKey": "freetextkey",
22
"entryValue": "TextValue",
23
"type": "freetext",
24
"required": false,
25
"maxLength": 15,
26
"children": []
27
}
28
]
29
}
30
]
31
},
32
{
33
"entryKey": "pointkey",
34
"entryValue": "PointValue",
35
"type": "point",
36
"color": "red",
37
"shortcut": "3",
38
"children": []
39
},
40
{
41
"entryKey": "polygonkey",
42
"entryValue": "PolyValue",
43
"type": "polygon",
44
"color": "blue",
45
"shortcut": "5",
46
"children": []
47
},
48
{
49
"entryKey": "rectanglekey",
50
"entryValue": "RectValue",
51
"type": "rectangle",
52
"color": "black",
53
"shortcut": "8",
54
"children": []
55
}
56
]
Copied!
Label Configuration with nested Entries