APIs for working with recipes

Supported Formats

json

GET /api/recipes/:id
Get recipe details

This API returns a recipe object

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error
404 Not found

Examples

GET /api/recipes/48
200
{
  "id": 48,
  "user_id": 36,
  "name": "Recipe 48",
  "created_at": "2015-05-26T22:53:36.904Z",
  "updated_at": "2015-05-26T22:53:36.904Z",
  "copy_count": 1,
  "trigger_application": "custom_adapter",
  "action_applications": [
    "custom_adapter"
  ],
  "applications": [
    "custom_adapter"
  ],
  "description": "Recipe description 48",
  "parameters_schema": [
    {
      "label": "Status",
      "name": "status",
      "type": "string",
      "control_type": "text",
      "hint": "new/completed etc"
    }
  ],
  "running": false,
  "job_succeeded_count": 0,
  "job_failed_count": 0,
  "last_run_at": null,
  "config": [
    {
      "keyword": "application",
      "provider": "custom_adapter",
      "name": "custom_adapter",
      "account_id": 7
    }
  ],
  "author_name": "Test User36"
}
GET /api/recipes/100500
404
{
  "message": "Not found"
}

Params

Param name Description
id
required

Recipe ID

Validations:

  • Must be a number.


POST /api/recipes
Create recipe

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error

Examples

POST /api/recipes
{
  "name": "Send mail",
  "code": "{\"number\":0,\"provider\":\"clock\",\"name\":\"timer\",\"as\":\"timer\",\"keyword\":\"trigger\",\"dynamicPickListSelection\":{},\"toggleCfg\":{},\"input\":{\"interval\":\"5\",\"start_at\":\"\"},\"block\":[{\"number\":1,\"provider\":\"email\",\"name\":\"send_mail\",\"as\":\"send_mail\",\"keyword\":\"action\",\"dynamicPickListSelection\":{},\"toggleCfg\":{},\"input\":{},\"uuid\":\"cd865246-ece7-4188-845e-33d021664be3\"}],\"uuid\":\"c4b0778d-5a23-4c52-a5bb-4a99ae5d25ae\"}",
  "config": "[{\"keyword\":\"application\",\"name\":\"clock\",\"provider\":\"clock\"},{\"keyword\":\"application\",\"name\":\"email\",\"provider\":\"email\"}]"
}
200
{
  "success": true,
  "id": 116
}

Params

Param name Description
recipe
optional

Validations:

  • Must be a Hash

recipe[name]
optional

Name of the recipe

Validations:

  • Must be String

recipe[code]
optional

JSON string representing the recipe lines

Validations:

  • Must be String

recipe[config]
optional

JSON string representing the connection lines

Validations:

  • Must be String


PUT /api/recipes/:id
Update recipe

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error
404 Not found

Examples

PUT /api/recipes/1
{
  "name": "Send mail",
  "code": "{\"number\":0,\"provider\":\"clock\",\"name\":\"timer\",\"as\":\"timer\",\"keyword\":\"trigger\",\"dynamicPickListSelection\":{},\"toggleCfg\":{},\"input\":{\"interval\":\"5\",\"start_at\":\"\"},\"block\":[{\"number\":1,\"provider\":\"email\",\"name\":\"send_mail\",\"as\":\"send_mail\",\"keyword\":\"action\",\"dynamicPickListSelection\":{},\"toggleCfg\":{},\"input\":{},\"uuid\":\"cd865246-ece7-4188-845e-33d021664be3\"}],\"uuid\":\"c4b0778d-5a23-4c52-a5bb-4a99ae5d25ae\"}",
  "config": "[{\"keyword\":\"application\",\"name\":\"clock\",\"provider\":\"clock\"},{\"keyword\":\"application\",\"name\":\"email\",\"provider\":\"email\"}]"
}
200
{
  "success": true
}
PUT /api/recipes/2

200
{
  "success": false,
  "errors": {
    "running": [
      "can't modify running recipe"
    ]
  }
}

Params

Param name Description
id
required

Recipe ID

Validations:

  • Must be a number.

recipe
optional

Validations:

  • Must be a Hash

recipe[name]
optional

Name of the recipe

Validations:

  • Must be String

recipe[code]
optional

JSON string representing the recipe lines

Validations:

  • Must be String

recipe[config]
optional

JSON string representing the connection lines

Validations:

  • Must be String


GET /api/recipes
List recipes belonging to user

Find recipes of authenticated user with respect to different filters. Recipes are returned in descending ID order

Supported Formats

json

Errors

Code Description
500 Server error
401 Unauthorized

Examples

GET /api/recipes?active=false
200
{
  "items": [
    {
      "id": 10,
      "user_id": 15,
      "name": "Recipe 10",
      "created_at": "2015-05-26T22:53:34.626Z",
      "updated_at": "2015-05-26T22:53:34.626Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [],
      "applications": [],
      "description": "Recipe description 10",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    },
    {
      "id": 8,
      "user_id": 15,
      "name": "Recipe 8",
      "created_at": "2015-05-26T22:53:34.577Z",
      "updated_at": "2015-05-26T22:53:34.577Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 8",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}
GET /api/recipes?per_page=2
200
{
  "items": [
    {
      "id": 14,
      "user_id": 17,
      "name": "Recipe 14",
      "created_at": "2015-05-26T22:53:34.895Z",
      "updated_at": "2015-05-26T22:53:34.895Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [],
      "applications": [],
      "description": "Recipe description 14",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    },
    {
      "id": 13,
      "user_id": 17,
      "name": "Recipe 13",
      "created_at": "2015-05-26T22:53:34.872Z",
      "updated_at": "2015-05-26T22:53:34.872Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 13",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 11,
      "job_failed_count": 3,
      "last_run_at": "2015-05-26T22:43:34.864Z",
      "config": []
    }
  ]
}
GET /api/recipes?adapter_names_any=custom_adapter
200
{
  "items": [
    {
      "id": 17,
      "user_id": 19,
      "name": "Recipe 17",
      "created_at": "2015-05-26T22:53:35.130Z",
      "updated_at": "2015-05-26T22:53:35.130Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 17",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 15,
      "job_failed_count": 3,
      "last_run_at": "2015-05-26T22:43:35.120Z",
      "config": []
    },
    {
      "id": 16,
      "user_id": 19,
      "name": "Recipe 16",
      "created_at": "2015-05-26T22:53:35.101Z",
      "updated_at": "2015-05-26T22:53:35.101Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 16",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}
GET /api/recipes?per_page=2&since_id=22
200
{
  "items": [
    {
      "id": 21,
      "user_id": 21,
      "name": "Recipe 21",
      "created_at": "2015-05-26T22:53:35.363Z",
      "updated_at": "2015-05-26T22:53:35.363Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 21",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 20,
      "job_failed_count": 3,
      "last_run_at": "2015-05-26T22:43:35.353Z",
      "config": []
    },
    {
      "id": 20,
      "user_id": 21,
      "name": "Recipe 20",
      "created_at": "2015-05-26T22:53:35.337Z",
      "updated_at": "2015-05-26T22:53:35.337Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 20",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}
GET /api/recipes
200
{
  "items": [
    {
      "id": 26,
      "user_id": 23,
      "name": "Recipe 26",
      "created_at": "2015-05-26T22:53:35.615Z",
      "updated_at": "2015-05-26T22:53:35.615Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [],
      "applications": [],
      "description": "Recipe description 26",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    },
    {
      "id": 25,
      "user_id": 23,
      "name": "Recipe 25",
      "created_at": "2015-05-26T22:53:35.591Z",
      "updated_at": "2015-05-26T22:53:35.591Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 25",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 17,
      "job_failed_count": 4,
      "last_run_at": "2015-05-26T22:43:35.581Z",
      "config": []
    },
    {
      "id": 24,
      "user_id": 23,
      "name": "Recipe 24",
      "created_at": "2015-05-26T22:53:35.565Z",
      "updated_at": "2015-05-26T22:53:35.565Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 24",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}
GET /api/recipes?adapter_names_all=custom_adapter%2Ccustom_adapter1
200
{
  "items": [
    {
      "id": 29,
      "user_id": 25,
      "name": "Recipe 29",
      "created_at": "2015-05-26T22:53:35.802Z",
      "updated_at": "2015-05-26T22:53:35.802Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 29",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 16,
      "job_failed_count": 2,
      "last_run_at": "2015-05-26T22:43:35.793Z",
      "config": []
    }
  ]
}
GET /api/recipes?active=true
200
{
  "items": [
    {
      "id": 33,
      "user_id": 27,
      "name": "Recipe 33",
      "created_at": "2015-05-26T22:53:36.011Z",
      "updated_at": "2015-05-26T22:53:36.011Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 33",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 10,
      "job_failed_count": 1,
      "last_run_at": "2015-05-26T22:43:36.002Z",
      "config": []
    }
  ]
}
GET /api/recipes?page=2&per_page=2
200
{
  "items": [
    {
      "id": 36,
      "user_id": 29,
      "name": "Recipe 36",
      "created_at": "2015-05-26T22:53:36.197Z",
      "updated_at": "2015-05-26T22:53:36.197Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 36",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}
GET /api/recipes?order=activity
200
{
  "items": [
    {
      "id": 41,
      "user_id": 31,
      "name": "Recipe 41",
      "created_at": "2015-05-26T22:53:36.446Z",
      "updated_at": "2015-05-26T22:53:36.446Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "applications": [
        "custom_adapter",
        "custom_adapter1"
      ],
      "description": "Recipe description 41",
      "parameters_schema": [],
      "running": true,
      "job_succeeded_count": 18,
      "job_failed_count": 3,
      "last_run_at": "2015-05-26T22:43:36.437Z",
      "config": []
    },
    {
      "id": 42,
      "user_id": 31,
      "name": "Recipe 42",
      "created_at": "2015-05-26T22:53:36.469Z",
      "updated_at": "2015-05-26T22:53:36.469Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [],
      "applications": [],
      "description": "Recipe description 42",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    },
    {
      "id": 40,
      "user_id": 31,
      "name": "Recipe 40",
      "created_at": "2015-05-26T22:53:36.420Z",
      "updated_at": "2015-05-26T22:53:36.420Z",
      "copy_count": 1,
      "trigger_application": null,
      "action_applications": [
        "custom_adapter"
      ],
      "applications": [
        "custom_adapter"
      ],
      "description": "Recipe description 40",
      "parameters_schema": [],
      "running": false,
      "job_succeeded_count": 1,
      "job_failed_count": 0,
      "last_run_at": null,
      "config": []
    }
  ]
}

Params

Param name Description
adapter_names_any
optional

List of adapters names. Resulting recipes should use at least one of given adapters

Validations:

  • Must be String

adapter_names_all
optional

List of adapters names. Resulting recipes should use all of given adapters

Validations:

  • Must be String

active
optional

Is flow runnig. 'true' - running, 'false' - stopped, all recipes otherwise

Validations:

  • Must be String

since_id
optional

Find recipes with ID less than given

Validations:

  • Must be a number.

order
optional

Set ordering method or default if blank. Possible options: activity

Validations:

  • Must be String


PUT /api/recipes/:id/start
Start recipe

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error
404 Not found

Examples

PUT /api/recipes/109/start
200
{
  "success": true
}
PUT /api/recipes/111/start
200
{
  "success": false,
  "code_errors": [
    [
      0,
      [
        [
          "id",
          null,
          "can't be blank"
        ]
      ]
    ]
  ],
  "config_errors": []
}
PUT /api/recipes/112/start
200
{
  "success": true
}
PUT /api/recipes/114/start
404
{
  "message": "Not found"
}

Params

Param name Description
id
required

Recipe ID

Validations:

  • Must be a number.


PUT /api/recipes/:id/stop
Stop recipe

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error
404 Not found

Examples

PUT /api/recipes/57/stop
200
{
  "success": true
}
PUT /api/recipes/58/stop
404
{
  "message": "Not found"
}

Params

Param name Description
id
required

Recipe ID

Validations:

  • Must be a number.


DELETE /api/recipes/:id
Delete recipe

Supported Formats

json

Errors

Code Description
401 Unauthorized
500 Server error
404 Not found

Examples

DELETE /api/recipes/1
200
{
  "success": true
}
DELETE /api/recipes/3
404
{
  "message": "Not found"
}

Params

Param name Description
id
required

Recipe ID

Validations:

  • Must be a number.