Skip to content
Tony Pujals edited this page Oct 21, 2013 · 4 revisions

Start a harvest job to import retailer information published in USDA files into MongoDB.

Resource
POST jobs/harvest
Sample request
curl -X POST http://api.snapfinder.org/v1/jobs/harvest
Sample request with callback

When the harvest job is complete, a POST request can be submitted to a designated callback URI. If callback-data is provided, this will be included in the data posted to the callback URI.

curl -X POST http://api.snapfinder.org/v1/jobs/harvest
     -d '{"callback-uri":"http://callbackuri/","callback-data":"{\"key\":\"value\"}"'
Response

Returns immediately with HTTP 202 (Accepted). The job will start running. Job status can be retrieved with a GET request.

Sample callback
{
    "status": "success",
    "count": 193627,
    "timestamp": "Tue Sep 17 2013 13:12:44 GMT-0700 (PDT)",
    "callback-data": {
        "key": "value"
    },
    "_id": {
        "$oid": "5238b7bc1db286f61103c702"
    }
}

Clone this wiki locally