Work
Work is an *integration* unit, typically for imports and exports.
Most run continually, while some run to completion.
You generally would only use it through the Webadmin Integrations.
* *Workflow* A specific type of integration is a Workflow, must belong to a *Provider*
* *Provider* A company that provides api's. Facebook, Google Analytics, Marketo, etc.
* *Auth* An authentication/authorization for a provider to allow *work* to run.
* *Work* A single running instance of a workflow for an account.
Work List
https://api.lytics.io/api/workGet list of all running integrations (work) for this account.
{
"data": [
{
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"statuscode": "completed",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
]
}Work Create
https://api.lytics.io/api/workThere are a list of available work-types in the workflow api.
To create a work unit, there is a *config* block with the work configuration
settings, with the fields listed in the workflow.
``sh
curl -s -H "Authorization: $LIOKEY" \
-XPOST "https://api.lytics.io/api/work" -d '
{
"workflow_id":"eventscopy"
, "name":"Ecommerce Demo Copy"
, "config":{
"destination_aid": "2223"
}
}
' | jq '.'
``
{
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}{
"data": {
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"state": {},
"statuscode": "completed",
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
}Work Fetch
https://api.lytics.io/api/work/{id}Get single work resource
{
"data": {
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"state": {},
"statuscode": "completed",
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
}Work Delete
https://api.lytics.io/api/work/{id}No Content
Retrieve Work Status
https://api.lytics.io/api/work/_status{
"data": {
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"state": {},
"statuscode": "completed",
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
}Work Command Post
https://api.lytics.io/api/work/{id}/{cmd}Send a work command
{
"data": {
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"state": {},
"statuscode": "completed",
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
}Work Bounce
https://api.lytics.io/api/work/_bounceall{
"data": {
"account_id": "4f7b525bdba058fc096757a6",
"aid": 12,
"config": {
"delimiter": null,
"email_to": "[email protected]",
"fields": [],
"limit": null,
"segment_id": "d5975ab901f7f660845c95ee6aa3cadd",
"table": "user",
"write_headers": true
},
"state": {},
"statuscode": "completed",
"hidden": false,
"id": "ca756c13469228b723652f1e5168650f",
"created": "2014-08-04T21:18:20.124Z",
"updated": "2014-08-04T21:18:20.124Z",
"runtime": "",
"deleted": false,
"tag": "",
"user_id": "50f4c7c6e327a73ae8000004",
"work_state_version": 0,
"workflow": "lytics_simple_csv_export",
"workflow_id": "75ce615fdfa048b7a5d5ea41fe7c1260"
}
}