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.
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
"Authorization": "Token <your_DataGym_API_token>"
Request parameter
https://app.datagym.ai/api/v1/project?token=<your_DataGym_API_token>
[{"id": "17b0bda7-fc2a-4423-9269-ac28914bb7c8","name": "Project1","shortDescription": "Project1 Description","description": null,"timestamp": 1582719639296,"labelConfigurationId": "8ffd901f-7b33-42f9-bf6e-86dd68e16cbd","labelIterationId": "42527661-f9d5-4362-901b-d346d936daa5","owner": "1801d7a4-cdb8-4667-bbda-f2b614626586","datasets": [{"id": "6e7ebeef-9c84-41c5-84fd-7696ce92c484","name": "Dataset1","shortDescription": null,"timestamp": 1583144402428,"owner": "1801d7a4-cdb8-4667-bbda-f2b614626586","imagesCount": 0,"projectCount": 1},{"id": "85e159fa-0096-4d58-95aa-5503dc3ef33a","name": "Dataset2","shortDescription": "Dataset2 short description","timestamp": 1583140144066,"owner": "1801d7a4-cdb8-4667-bbda-f2b614626586","imagesCount": 3,"projectCount": 1}]},{"id": "9eee46d9-53ab-4c0c-8cea-075ec4ce08f5","name": "Project2","shortDescription": "Project2 Description","description": null,"timestamp": 1582710802922,"datasets": [],"labelConfigurationId": "818d3b3b-9445-4afb-bbad-781a23858486","labelIterationId": "0e3bc344-5c2d-4587-aff9-a1a672ca0c75","owner": "de82f6de-4196-47d8-afe8-f2b614626586"}]
{"msg": "Unauthorized. None or invalid credentials."}
{"id": "7e3cfb2d-4ffc-4d85-bdec-be54775ae6b9","name": "Dataset1","shortDescription": null,"timestamp": 1584715253826,"owner": "2b02b66a-c370-4388-99b4-97fac18092258","projectCount": 1,"images": [{"id": "870b286b-b04b-475f-84f4-eb82fa5dae7e","timestamp": 1584715262990,"imageType": "LOCAL","imageName": "test_image_1.jpg"},{"id": "c09d8c87-98ba-44dd-9c7e-9ad281763344","timestamp": 1584957405034,"imageType": "SHAREABLE_LINK","imageName": "test_image_2.jpg"}]}
{"msg": "Unauthorized. None or invalid credentials."}
[{"id": "bfe5dcfd-adee-476e-81a9-3eee75c7c952","name": "Dataset1","shortDescription": "Short_Decription","timestamp": 1582710735167,"owner": "de82f6de-4196-47d8-afe8-f2b614876586","projectCount": 1,"images": [{"id": "cdd8e9d1-725f-49e3-9c16-7565706f1520","timestamp": 1582710744785,"imageType": "LOCAL","imageName": "87703344_10221265040273456_8218964372425277440_o.jpg"},{"id": "89f169e2-1c37-4b9c-a185-563bb6905c43","timestamp": 1582710745154,"imageType": "LOCAL","imageName": "87759806_10221265165156578_6988954776155193344_o.jpg"}]},{"id": "bfe5dcfd-adee-476e-81a9-3eee75c7c922","name": "Dataset2","shortDescription": "Short_Decription","timestamp": 1582710735167,"owner": "de82f6de-4196-47d8-afe8-f2b614876546","projectCount": 0,"images": []}]
{"msg": "Unauthorized. None or invalid credentials."}
{"id": "45d62020-8f31-4e38-8c1a-f78dcb03135b","name": "Dataset1","shortDescription": "Dataset1_description","timestamp": 1582718162835,"owner": "1801d7a4-cdb8-4667-bbda-6af6f86b29d6","projectCount": 0,"images": []}
{"msg": "Unauthorized. None or invalid credentials."}
​
{"msg": "Unauthorized. None or invalid credentials."}
​
​
{"msg": "Unauthorized. None or invalid credentials."}
[{"internal_image_ID": "3b9c67f9-c2a2-4370-b080-5692b1c8b7ca","external_image_ID": "test_image.jpg","imageUrl": "https://test/test_image.jpg","imageUploadStatus": "SUCCESS"},{"internal_image_ID": null,"external_image_ID": null,"imageUrl": "https://encrypted-tbn0.gstatic/test.jpg","imageUploadStatus": "FAILED"},{"internal_image_ID": null,"external_image_ID": null,"imageUrl": "https://encrypted-tbn1/test2.gif","imageUploadStatus": "UNSUPPORTED_FORMAT"}]
{"msg": "Unauthorized. None or invalid credentials."}
{'id': '9316607e-2d3e-402c-810a-9852c63217a0','image_name': 'awesome_image','image_type': 'LOCAL','timestamp': 1592377072458}
{"msg": "Unauthorized. None or invalid credentials."}
​
{"msg": "Unauthorized. None or invalid credentials."}
​
{"msg": "Unauthorized. None or invalid credentials."}
[{"label_classes": [{"class_name": "rectangle1_key","geometry_type": "rectangle"}]},{"internal_image_ID": "87dcfde0-30c3-446a-b9dc-3121621c40b5","external_image_ID": "87678961_10221265039233430_6011932407320543232_o.jpg","labeler": "25dcfde0-30c3-336a-b9dc-2521621c40f4","status": "completed","global_classifications": {},"labels": {"rectangle1_key": [{"geometry": [{"x": 535,"y": 258,"w": 804,"h": 541}],"classifications": {}}]}}]
{"msg": "Unauthorized. None or invalid credentials."}
​
{"msg": "Unauthorized. None or invalid credentials."}
Streams the .bmp file
{"msg": "Unauthorized. None or invalid credentials."}
{"key" : "ex_notfound","params" : [ "lcEntry", "entry_key", "unknown-key" ],"msg" : "lcEntry with entry_key unknown-key not found.","code" : 404,"details" : [ ]}
​
{"msg": "Unauthorized. None or invalid credentials."}
​
{"msg": "Unauthorized. None or invalid credentials."}
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:
[{"entryKey": "linekey","entryValue": "LineValue","type": "line","color": "green","shortcut": "1","children": []},{"entryKey": "pointkey","entryValue": "PointValue","type": "point","color": "red","shortcut": "3","children": []},{"entryKey": "polygonkey","entryValue": "PolyValue","type": "polygon","color": "blue","shortcut": "5","children": []},{"entryKey": "rectanglekey","entryValue": "RectValue","type": "rectangle","color": "black","shortcut": "8","children": []}]
After the upload you will see the following Label Configuration for this Project:
Example: JSON with all classifications:
[{"entryKey": "checklistkey","entryValue": "CheckValue","type": "checklist","required": true,"options": {"firstCheckListOptionKey": "firstCheckListOptionValue","secondCheckListOptionKey": "secondCheckListOptionValue","thirdCheckListOptionKey": "thirdCheckListOptionValue"},"children": []},{"entryKey": "freetextkey","entryValue": "FreeTextValue","type": "freetext","required": false,"maxLength": 15,"children": []},{"entryKey": "selectkey","entryValue": "SelectValue","type": "select","required": false,"options": {"firstSelectOptionKey": "firstSelectOptionValue","secondSelectOptionKey": "secondSelectOptionValue","thirdSelectOptionKey": "thirdSelectOptionValue"},"children": []}]
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:
[{"entryKey": "linekey","entryValue": "LineValue","type": "line","color": "green","shortcut": "1","children": [{"entryKey": "checklistkey","entryValue": "CheckValue","type": "checklist","required": true,"options": {"firstCheckListOptionKey": "firstCheckListOptionValue","secondCheckListOptionKey": "secondCheckListOptionValue","thirdCheckListOptionKey": "thirdCheckListOptionValue"},"children": [{"entryKey": "freetextkey","entryValue": "TextValue","type": "freetext","required": false,"maxLength": 15,"children": []}]}]},{"entryKey": "pointkey","entryValue": "PointValue","type": "point","color": "red","shortcut": "3","children": []},{"entryKey": "polygonkey","entryValue": "PolyValue","type": "polygon","color": "blue","shortcut": "5","children": []},{"entryKey": "rectanglekey","entryValue": "RectValue","type": "rectangle","color": "black","shortcut": "8","children": []}]