HTTP Periodic Task Simulate


This endpoint will accept a Task definition, and it will return the output from a sample run of that task. The Task being simulated is not persisted on flowthings.io. You can either simulate a new or an existing task.

Request

Headers

NameDescription
Content-Typeapplication/json
X-Auth-TokenAuthentication Token

We have two different endpoints for simulation:

Simulate Existing Task

To simulate an existing one:

GET https://api.flowthings.io/v0.1/<accountId>/task/<taskId>/simulate

Required Fields

At a minimum you must provide a task destination and either a source or js function.

Example

GET https://api.flowthings.io/v0.1/bob/task/u554292119f3a1a606da56d0b/simulate

Simulate New Task

POST https://api.flowthings.io/v0.1/<accountId>/task/simulate

Example

POST https://api.flowthings.io/v0.1/bob/task/simulate

{
  {"destination":"/test","source": { "http": {"get":{"url": "http://an/rss/feed"},"parser": "rss"}}}}

Response

Http Codes

CodeDescription
201Resource Created
400Bad Request
401Unauthorized
503Service Unavailable

Output

The output will be the same for either, and will likely be very large:

  {
  head : {
    status : 200,
    ok : true,
    messages : [ ],
    errors : [ ],
    references : { }
  },
  body : {
    drops : [
      {
        //article output
      }, ...
    ],

    errors : [ ]
  }
}

If there is a parsing error:

  {
  head : {
    status : 200,
    ok : true,
    messages : [ ],
    errors : [ ],
    references : { }
  },
  body : {
    parse error: "Error on line 21: The prefix \wn\ for attribute \wn:size\ associated with an element type \media:thumbnail\ is not bound.,"
    raw: // ... article output ...
  }
}