optilyz API

optilyz API documentation

3.0.0

Automations

Automations | Get all automations

2.0.0

get


Header

Field Type Description
Content-Type String HTTP Request Header - Only "application/json" content type is allowed. Otherwise, your request is rejected with 415(Unsupported Media Type) status.
Authorization String Bearer scheme with your API Key as the value.
{
  "Content-Type": "application/json",
  "Authorization": "Bearer {{api_key}}"
}

Parameter

Field Type Description
filter
optional
String Optional filter for the automations
Allowed values:
"state",
"createdAt"
GET https://www.optilyz.com/api/v2/automations?filter=state%3D%3Dlive,createdAt%3E%3D2016-12-01T09:00:00

Success 200

Field Type Description
automations Object[] List of active automations. -> see "Automations - Get automation data" for details
HTTP/1.1 200 OK
[
  {
    "_id": "000...001",
    "state": "paused",
    "createdAt": "2016-12-01T09:30:58.359Z",
    "name": "Automation 1",
    "postage": { ... },
    "items": [ { ... } ],
    "variations": [ { ... } ]
  },
  {
    "_id": "000...002",
    "state": "live",
    "createdAt": "2016-12-01T09:30:58.359Z",
    "name": "Automation 2",
    "postage": { ... },
    "items": [ { ... }, { ... } ],
    "variations": [ { ... } ]
  },
  {
    "_id": "000...003",
    "state": "live",
    "createdAt": "2016-12-01T09:30:58.359Z",
    "name": "Automation 3",
    "postage": { ... },
    "items": [ { ... } ],
    "variations": [ { ... } ]
  }
]

Error 4xx

Name Description
404-ResourceNotFoundError No automations were found.
HTTP/1.1 404 Not Found
{
  "message": "No Automations found!",
  "code": "ResourceNotFound"
}

Automations | Get automation data

2.2.0

get


Header

{
  "Content-Type": "application/json",
  "Authorization": "Bearer {{api_key}}"
}

Parameter

Field Type Description
id String ID of the automation
GET https://www.optilyz.com/api/v2/automations/000...002

Success 200

Field Type Description
_id String Unique identifier of the automation.
state String Current state of the automation.
createdAt Date Date when the automation was created initially.
name String Name of the automation.
postage Object Definition of trigger to create campaigns out of the automation
createVolume
optional
Number Minimum amount of collected recipients before a campaign will be created
createDays
optional
Object When to create campaigns - if all createDays are false, creation will happen every day (same as if all were true)
1
optional
Boolean Create campaigns on Sunday
2
optional
Boolean Create campaigns on Monday
3
optional
Boolean Create campaigns on Tuesday
4
optional
Boolean Create campaigns on Wednesday
5
optional
Boolean Create campaigns on Thursday
6
optional
Boolean Create campaigns on Friday
7
optional
Boolean Create campaigns on Saturday
items Object[] List of items defined in the automation.
name String Name of the product item.
vouchers Object[] List of all configured vouchers within the product item, shape depending on voucher type:
addressField String For SingleFieldIndividualItem: Name of the property within the submitted address data to take the voucher code from.
voucherValue String For SingleFieldIndividualItem: Configured value for this voucher.
voucherCode String For SingleVariationVoucher, single voucher: The voucher code.
variationId String For SingleVariationVoucher, multiple vouchers: Index of the variation
variations Object[] List of all configured variations.
id Number ID of the variation - use to assign a recipient to this variation -> see "Recipients - Enqueue one recipient" and "Recipients - Enqueue multiple recipients".
name String Display-name of the variation.
visuals String[] List of all visuals (IDs) assigned to the variation
letter String Alphabetical name of the variation (A, B, C, etc.).
customName
optional
String Customer-defined name of the variation.
HTTP/1.1 200 OK
{
  "_id": "000...002",
  "state": "live",
  "createdAt": "2016-12-01T09:30:58.359Z",
  "name": "Automation 2",
  "postage": {
    "createVolume": 500,
    "createDays": {
       1: false,
       2: false,
       3: false,
       4: true,
       5: false,
       6: false,
       7: false
     }
  },
  "items": [
    {
      "name": "Postcard",
      "vouchers": [
        {
          "addressField": "voucherCode1",
          "voucherValue": "10 €"
        }
      ]
    },
    {
      "name": "Letter",
      "vouchers": [
        {
          "addressField": "voucherCode2",
          "voucherValue": "5 %"
        }
      ]
    }
  ],
  "variations": [
    {
      "id": 1,
      "name": "Variation A - Birthday",
      "letter": "A",
      "customName": "Birthday",
      "visuals": [
        "001...001",
        "001...003"
      ]
    },
    {
      "id": 2,
      "name": "Variation B",
      "letter": "B",
      "visuals": [
        "001...002",
        "001...003"
      ]
    }
  ]
}

Error 4xx

Name Description
404-ResourceNotFoundError Automation was not found.
HTTP/1.1 404 Not Found
{
  "message": "Automation with ID \"000...002\" not found!",
  "code": "ResourceNotFound"
}

Note: Further sections on recipients and configurations have been omitted to ensure compliance with semantic content retention.