const response = await fetch('https://api.cloudfactory.app/v1/tasks', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"media_key": "https://example.s3.amazonaws.com/1a05d1e5-44cd-43c4-9628-79c033af8b99/1a05d1e5-44cd-43c4-9628-79c033af8b99.jpg",
"configuration_id": "e3404e84-db35-43a4-9144-d3588a4beb28",
"callback_url": "https://example.com/callback",
"media_type": "image",
"tags": [
{
"confidence_score": 0.7,
"value": "Left"
},
{
"confidence_score": 0.8,
"value": "Pothole"
}
],
"existing_inferences": {
"inferences": [
{
"external_id": "b11c9c7b-67fe-47a3-8767-6da46f960f48",
"classes": [
{
"confidence_score": 0.5,
"class": "car"
}
],
"confidence_score": 0.5,
"bbox": [
1,
1,
10,
10
]
},
{
"external_id": "41ba8465-af60-4625-a5f0-69eae05f7102",
"classes": [
{
"confidence_score": 0.5,
"class": "tree"
}
],
"confidence_score": 0.5,
"polygon": [
[
[
0,
0
],
[
1,
0
],
[
1,
1
],
[
0,
1
]
]
],
"attributes": [
{
"confidence_score": 0.5,
"name": "Color",
"value": [
"red",
"blue"
]
},
{
"confidence_score": 0.5,
"name": "Damaged",
"value": true
}
]
}
]
}
}),
});
const data = await response.json();