A few things that could be improved:
- It is not immediately clear that the
name key is required in the JSON payload, and that it needs to be unique for a new task to be created
- If you submit the same
/task POST twice (with the same name the response is the same, and it's then up to the user to figure out that this is actually an existing task based on the id in the response:
> curl -X POST https://staging.maproulette.org/api/v2/task \
-H "Content-Type: application/json" \
-H "apiKey: XXXXXX \
-d '{"name":"12345","parent":40367,"geometries":"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[1,1]}}]}","instruction":"Test task"}'
{"id":171072323,"name":"12345","created":"2025-01-29T16:31:30.849Z","modified":"2025-01-29T16:31:30.849Z","parent":40367,"instruction":"Test task","geometries":{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1,1]}}]},"review":{},"priority":0,"errorTags":"","tags":[]}%
~ ................................................................................................................................................... at 09:31:30 AM
> curl -X POST https://staging.maproulette.org/api/v2/task \
-H "Content-Type: application/json" \
-H "apiKey: XXXXXX \
-d '{"name":"12345","parent":40367,"geometries":"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[1,1]}}]}","instruction":"Test task"}'
{"id":171072323,"name":"12345","created":"2025-01-29T16:31:33.994Z","modified":"2025-01-29T16:31:33.994Z","parent":40367,"instruction":"Test task","geometries":{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1,1]}}]},"review":{},"priority":0,"errorTags":"","tags":[]}%
A few things that could be improved:
namekey is required in the JSON payload, and that it needs to be unique for a new task to be created/taskPOSTtwice (with the samenamethe response is the same, and it's then up to the user to figure out that this is actually an existing task based on theidin the response: