{"__v":15,"_id":"567c4829815f250d0094adbb","category":{"__v":8,"_id":"5661fdcb55e4450d00e62c79","pages":["5661fdcc55e4450d00e62c80","5661fdcc55e4450d00e62c81","5661fdcc55e4450d00e62c82","5661fdcc55e4450d00e62c83","5661fdcc55e4450d00e62c84","5661fdcc55e4450d00e62c85","5661fdcc55e4450d00e62c86","5661fdcc55e4450d00e62c87","5661fdcc55e4450d00e62c88","567c46a37c40060d005604c1","567c479a8eb5b20d00210557","567c4829815f250d0094adbb","567c48a3815f250d0094adbd","567c496b7c40060d005604c5","567c4af88eb5b20d00210559","567c4cb9abbcf90d00ca50c2"],"project":"5511df3be2990b0d00fb071d","version":"5661fdca55e4450d00e62c73","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-27T12:30:20.218Z","from_sync":false,"order":1,"slug":"alerts-notifications","title":"Tasks & Results"},"parentDoc":null,"project":"5511df3be2990b0d00fb071d","user":"5511dee39171e82b00897349","version":{"__v":2,"_id":"5661fdca55e4450d00e62c73","project":"5511df3be2990b0d00fb071d","createdAt":"2015-12-04T20:55:38.639Z","releaseDate":"2015-12-04T20:55:38.639Z","categories":["5661fdcb55e4450d00e62c74","5661fdcb55e4450d00e62c75","5661fdcb55e4450d00e62c76","5661fdcb55e4450d00e62c77","5661fdcb55e4450d00e62c78","5661fdcb55e4450d00e62c79","567c42b13241c20d00b7312e"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-24T19:31:53.713Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl 'https://api.astrodigital.com/v2.0/tasks' --data '{\n  \"name\":\"Our Arugula Field\", \n  \"products\": [{\"product\": \"ndvi_image\", \"actions\": [\"mapbox\"]}], \n  \"recurring\":true,\n  \"query\": {\n    \"date_from\": \"2015-11-01\",\n    \"date_to\": \"2016-01-01\"\n    \"aoi\": {\n      \"type\": \"Polygon\",\n      \"coordinates\": [\n        [\n            [-122.62664794921874, 38.81403111409755],\n            [-122.62664794921874, 39.07464374293249],\n            [-122.16796875, 39.07464374293249],\n            [-122.16796875, 38.81403111409755],\n            [-122.62664794921874, 38.81403111409755]\n        ]\n      ]\n    }\n    \"aoi_coverage_percentage\":90,\n  }\n}' -H 'Content-Type: application/json' -H 'Authorization: Token YOUR_TOKEN'"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n    \"id\":1,\n    \"name\":\"My Alert\",\n    \"created_at\":\"2016-01-27T15:24:03.126309Z\",\n    \"updated_at\":\"2016-01-27T15:24:03.126335Z\",\n    \"query\":{\n        \"date_to\":\"2016-08-02\",\n        \"aoi\":{\n            \"coordinates\":[\n              [\n                [10.571722984313965,51.38249533118676],\n                [10.571722984313965,51.39307388836406],\n                [10.588459968566895,51.39307388836406],\n                [10.588459968566895,51.38249533118676],\n                [10.571722984313965,51.38249533118676]\n              ]\n            ],\n            \"type\":\"Polygon\"\n        },\n        \"date_from\":\"2016-02-01\"\n    },\n    \"recurring\":true,\n    \"end_date\":null,\n    \"status\":\"ACTIVE\",\n    \"status_time\":\"2016-01-27T15:24:03.126087Z\",\n    \"expected_results\":20,\n    \"aoi\":1,\n    \"products\":[\n        {\n            \"product\":\"true_color\",\n            \"actions\":[\"mapbox\"]\n        }\n    ]\n}","language":"json","status":200},{"name":"","code":"{\"detail\":\"Invalid request. The following fields are either missing or have no value: name\"}","language":"json","status":400}]},"settings":"56a8d993c0e02f0d007fa916","auth":"required","params":[],"url":"/tasks"},"isReference":false,"order":2,"body":"Create a new Task with the specified data, the response will be the newly created Task representation with a platform unique ID. Tasks with a `recurring=true`, will automatically be set up as recurring tasks and will be run on a schedule by the platform.\n\nEach Task will need a valid `name`, `query` and `products` array. If you'd like to receive email notifications when the Task has new Results, set `notify=true` on the payload, this defaults to `false`.\n\nThe `products` array is composed of valid options from [/products/](doc:products) along with matching valid actions. Choosing invalid Product/action combinations will result in a Task creation failure.\n\nThe `query` object is where you are passing the bulk of the instructions to the platform. The table below lists the main items expected in the query object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Object name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"date_from\",\n    \"0-1\": \"Date in `YYYY-MM-DD` format, can be in the past to look back in time for imagery.\",\n    \"1-0\": \"date_to\",\n    \"1-1\": \"Date in `YYYY-MM-DD` format, dates in the future will automatically mark the Task as recurring, running automatically each time the platform has new data.\",\n    \"2-0\": \"aoi\",\n    \"2-1\": \"The API accepts Features, FeatureCollections or raw geometries where the geometry types are of Polygon or MultiPolygon. All geometries must be non-intersecting. More about how to work with areas of interest is covered in this [article](doc:areas-of-interest-best-practices)\",\n    \"3-0\": \"aoi_coverage_percentage\",\n    \"3-1\": \"Shows minimal percentage of AOI covered with pixels. aoi_coverage_percentage = 80 means that the AOI will be covered with satellite image pixels at least by 80%\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Usage Limits\",\n  \"body\": \"The Platform is incredibly powerful and lets you process imagery in a variety of ways over a long time period. But keep in mind, that creation of Tasks and receiving the Results is all subject to your usage plan limitations. See more info [here](doc:limitations-for-astro-digital-api-calls)\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Distant Polygons\",\n  \"body\": \"Submitting a Task with multiple polygons (as a FeatureCollection) is fine. However, you occasionally won't receive any results if the polygons are too far away from each other (> 50km). For these polygons, try posting two separate tasks.\"\n}\n[/block]","excerpt":"","slug":"tasks-1","type":"endpoint","title":"/tasks"}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format


Documentation

Create a new Task with the specified data, the response will be the newly created Task representation with a platform unique ID. Tasks with a `recurring=true`, will automatically be set up as recurring tasks and will be run on a schedule by the platform. Each Task will need a valid `name`, `query` and `products` array. If you'd like to receive email notifications when the Task has new Results, set `notify=true` on the payload, this defaults to `false`. The `products` array is composed of valid options from [/products/](doc:products) along with matching valid actions. Choosing invalid Product/action combinations will result in a Task creation failure. The `query` object is where you are passing the bulk of the instructions to the platform. The table below lists the main items expected in the query object. [block:parameters] { "data": { "h-0": "Object name", "h-1": "Description", "0-0": "date_from", "0-1": "Date in `YYYY-MM-DD` format, can be in the past to look back in time for imagery.", "1-0": "date_to", "1-1": "Date in `YYYY-MM-DD` format, dates in the future will automatically mark the Task as recurring, running automatically each time the platform has new data.", "2-0": "aoi", "2-1": "The API accepts Features, FeatureCollections or raw geometries where the geometry types are of Polygon or MultiPolygon. All geometries must be non-intersecting. More about how to work with areas of interest is covered in this [article](doc:areas-of-interest-best-practices)", "3-0": "aoi_coverage_percentage", "3-1": "Shows minimal percentage of AOI covered with pixels. aoi_coverage_percentage = 80 means that the AOI will be covered with satellite image pixels at least by 80%" }, "cols": 2, "rows": 4 } [/block] [block:callout] { "type": "warning", "title": "Usage Limits", "body": "The Platform is incredibly powerful and lets you process imagery in a variety of ways over a long time period. But keep in mind, that creation of Tasks and receiving the Results is all subject to your usage plan limitations. See more info [here](doc:limitations-for-astro-digital-api-calls)" } [/block] [block:callout] { "type": "warning", "title": "Distant Polygons", "body": "Submitting a Task with multiple polygons (as a FeatureCollection) is fine. However, you occasionally won't receive any results if the polygons are too far away from each other (> 50km). For these polygons, try posting two separate tasks." } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}