Quick startIn a NutshellEntitiesAttributesAttribute LibraryFAQ
Management API
OverviewAuthentication

API Reference

API Errors

#Management API

The Management API includes all information about your applications, campaigns, rulesets, attributes, and webhooks.

#Authentication

Management API operations use a simple bearer token to authenticate requests. You can obtain a bearer token from your credentials using the createSession operation. The token property of the response is used to authenticate further requests with an HTTP header like Authorization: Bearer $TOKEN.

#Sessions

Operations for logging in/out of the Campaign Manager.

#Create a Session

POST /v1/sessions

Request

curl https://example.talon.one/v1/sessions \
 -X POST \
 -d '{
  "email": "albin.hauck@streichward.org",
  "password": "eq5jxxif03"
}'

Response (201)

{
  "created": "2016-11-23T23:29:45Z",
  "token": "uggiyt0t1y",
  "userId": 97
}

#Destroy a Session

DELETE /v1/sessions

Request

curl https://example.talon.one/v1/sessions \
 -X DELETE

Response (204)

{}

#Applications

#Create an Application

POST /v1/applications

Create a new application in the current account.

Request

curl https://example.talon.one/v1/applications \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "caseSensitivity": "sensitive",
  "currency": "EUR",
  "description": "description",
  "key": "x2gpw8ypx9fkiiqj",
  "name": "ACME MyApplication",
  "timezone": "UTC"
}'

Response (201)

{
  "accountId": 94,
  "caseSensitivity": "insensitive-uppercase",
  "created": "2016-08-03T04:15:37Z",
  "currency": "EUR",
  "description": "description",
  "id": 15,
  "key": "x2gpw8ypx9fkiiqj",
  "modified": "2016-09-23T20:28:53Z",
  "name": "ACME MyApplication",
  "timezone": "UTC"
}

#List Applications

GET /v1/applications

List all application in the current account.

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/applications \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "accountId": 94,
      "caseSensitivity": "insensitive-uppercase",
      "created": "2016-08-03T04:15:37Z",
      "currency": "EUR",
      "description": "description",
      "id": 15,
      "key": "x2gpw8ypx9fkiiqj",
      "modified": "2016-09-23T20:28:53Z",
      "name": "ACME MyApplication",
      "timezone": "UTC"
    }
  ]
}

#Get Application

GET /v1/applications/{applicationId}

Get the application specified by the ID.

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accountId": 94,
  "caseSensitivity": "insensitive-uppercase",
  "created": "2016-08-03T04:15:37Z",
  "currency": "EUR",
  "description": "description",
  "id": 15,
  "key": "x2gpw8ypx9fkiiqj",
  "modified": "2016-09-23T20:28:53Z",
  "name": "ACME MyApplication",
  "timezone": "UTC"
}

#Update Application data

PUT /v1/applications/{applicationId}

Change the application specified by the ID.

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "caseSensitivity": "sensitive",
  "currency": "EUR",
  "description": "description",
  "key": "x2gpw8ypx9fkiiqj",
  "name": "ACME MyApplication",
  "timezone": "UTC"
}'

Response (200)

{
  "accountId": 94,
  "caseSensitivity": "insensitive-uppercase",
  "created": "2016-08-03T04:15:37Z",
  "currency": "EUR",
  "description": "description",
  "id": 15,
  "key": "x2gpw8ypx9fkiiqj",
  "modified": "2016-09-23T20:28:53Z",
  "name": "ACME MyApplication",
  "timezone": "UTC"
}

#Delete an Application

DELETE /v1/applications/{applicationId}

Delete the application specified by the ID. Also deletes associated data.

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Campaigns

Campaigns are the primary resource used to control the behaviour of the Talon.One Rule Engine. They combine rulesets, coupons, and limits into a single unit.

#Create a Campaign

POST /v1/applications/{applicationId}/campaigns

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "activeRulesetId": 36,
  "attributes": {
    "BaggageAllowance": 83,
    "VenueDescription": "Venue description"
  },
  "couponSettings": {
    "couponPattern": "9pnpdfu35x",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "description": "description",
  "endTime": "2019-01-19T15:38:47.939643471Z",
  "features": [
    "loyalty",
    "referrals"
  ],
  "limits": [
    {
      "action": "redeemReferral",
      "entities": [
        "Coupon"
      ],
      "limit": 61.84
    }
  ],
  "name": "Now 10% on all 24 month plans",
  "referralSettings": {
    "couponPattern": "vj3w9i4hh4",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "startTime": "2018-08-21T15:38:47.939643471Z",
  "state": "disabled",
  "tags": [
    "referral",
    "international",
    "labor day"
  ]
}'

Response (201)

{
  "activeRulesetId": 9,
  "applicationId": 85,
  "attributes": {
    "LastOrderDate": "2016-10-08T14:00:58Z",
    "NumberOfSegments": "Travel segments",
    "ReferralPath": "Referral path"
  },
  "couponRedemptionCount": 59,
  "couponSettings": {
    "couponPattern": "ov8nbuuvgx",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "created": "2016-07-23T06:46:06Z",
  "createdBy": "Campaign.createdBy",
  "description": "description",
  "discountCount": 78,
  "endTime": "2018-12-24T15:38:47.939643471Z",
  "features": [
    "referrals",
    "referrals",
    "referrals"
  ],
  "id": 51,
  "lastActivity": "2016-07-24T03:21:34Z",
  "limits": [
    {
      "action": "setDiscount",
      "entities": [
        "Coupon"
      ],
      "limit": 40.53
    }
  ],
  "name": "Now 10% on all 24 month plans",
  "referralRedemptionCount": 45,
  "referralSettings": {
    "couponPattern": "gkb8vayc77",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "startTime": "2018-08-21T15:38:47.939643471Z",
  "state": "archived",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "updated": "2016-07-14T03:23:43Z",
  "updatedBy": "Campaign.updatedBy",
  "userId": 51
}

#List your Campaigns

GET /v1/applications/{applicationId}/campaigns

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
campaignState string - Filter results by the state of the campaign.

Request

curl https://example.talon.one/v1/applications/42/campaigns \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "activeRulesetId": 9,
      "applicationId": 85,
      "attributes": {
        "LastOrderDate": "2016-10-08T14:00:58Z",
        "NumberOfSegments": "Travel segments",
        "ReferralPath": "Referral path"
      },
      "couponRedemptionCount": 59,
      "couponSettings": {
        "couponPattern": "ov8nbuuvgx",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "created": "2016-07-23T06:46:06Z",
      "createdBy": "Campaign.createdBy",
      "description": "description",
      "discountCount": 78,
      "endTime": "2018-12-24T15:38:47.939643471Z",
      "features": [
        "referrals",
        "referrals",
        "referrals"
      ],
      "id": 51,
      "lastActivity": "2016-07-24T03:21:34Z",
      "limits": [
        {
          "action": "setDiscount",
          "entities": [
            "Coupon"
          ],
          "limit": 40.53
        }
      ],
      "name": "Now 10% on all 24 month plans",
      "referralRedemptionCount": 45,
      "referralSettings": {
        "couponPattern": "gkb8vayc77",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "startTime": "2018-08-21T15:38:47.939643471Z",
      "state": "archived",
      "tags": [
        "referral",
        "international",
        "labor day"
      ],
      "updated": "2016-07-14T03:23:43Z",
      "updatedBy": "Campaign.updatedBy",
      "userId": 51
    }
  ]
}

#Get a Campaign

GET /v1/applications/{applicationId}/campaigns/{campaignId}

Parameters

applicationId integer
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "activeRulesetId": 9,
  "applicationId": 85,
  "attributes": {
    "LastOrderDate": "2016-10-08T14:00:58Z",
    "NumberOfSegments": "Travel segments",
    "ReferralPath": "Referral path"
  },
  "couponRedemptionCount": 59,
  "couponSettings": {
    "couponPattern": "ov8nbuuvgx",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "created": "2016-07-23T06:46:06Z",
  "createdBy": "Campaign.createdBy",
  "description": "description",
  "discountCount": 78,
  "endTime": "2018-12-24T15:38:47.939643471Z",
  "features": [
    "referrals",
    "referrals",
    "referrals"
  ],
  "id": 51,
  "lastActivity": "2016-07-24T03:21:34Z",
  "limits": [
    {
      "action": "setDiscount",
      "entities": [
        "Coupon"
      ],
      "limit": 40.53
    }
  ],
  "name": "Now 10% on all 24 month plans",
  "referralRedemptionCount": 45,
  "referralSettings": {
    "couponPattern": "gkb8vayc77",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "startTime": "2018-08-21T15:38:47.939643471Z",
  "state": "archived",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "updated": "2016-07-14T03:23:43Z",
  "updatedBy": "Campaign.updatedBy",
  "userId": 51
}

#Update a Campaign

PUT /v1/applications/{applicationId}/campaigns/{campaignId}

Parameters

applicationId integer
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "activeRulesetId": 36,
  "attributes": {
    "BaggageAllowance": 83,
    "VenueDescription": "Venue description"
  },
  "couponSettings": {
    "couponPattern": "9pnpdfu35x",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "description": "description",
  "endTime": "2019-01-19T15:38:47.939643471Z",
  "features": [
    "loyalty",
    "referrals"
  ],
  "limits": [
    {
      "action": "redeemReferral",
      "entities": [
        "Coupon"
      ],
      "limit": 61.84
    }
  ],
  "name": "Now 10% on all 24 month plans",
  "referralSettings": {
    "couponPattern": "vj3w9i4hh4",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "startTime": "2018-08-21T15:38:47.939643471Z",
  "state": "disabled",
  "tags": [
    "referral",
    "international",
    "labor day"
  ]
}'

Response (200)

{
  "activeRulesetId": 9,
  "applicationId": 85,
  "attributes": {
    "LastOrderDate": "2016-10-08T14:00:58Z",
    "NumberOfSegments": "Travel segments",
    "ReferralPath": "Referral path"
  },
  "couponRedemptionCount": 59,
  "couponSettings": {
    "couponPattern": "ov8nbuuvgx",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "created": "2016-07-23T06:46:06Z",
  "createdBy": "Campaign.createdBy",
  "description": "description",
  "discountCount": 78,
  "endTime": "2018-12-24T15:38:47.939643471Z",
  "features": [
    "referrals",
    "referrals",
    "referrals"
  ],
  "id": 51,
  "lastActivity": "2016-07-24T03:21:34Z",
  "limits": [
    {
      "action": "setDiscount",
      "entities": [
        "Coupon"
      ],
      "limit": 40.53
    }
  ],
  "name": "Now 10% on all 24 month plans",
  "referralRedemptionCount": 45,
  "referralSettings": {
    "couponPattern": "gkb8vayc77",
    "validCharacters": [
      "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
      "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
    ]
  },
  "startTime": "2018-08-21T15:38:47.939643471Z",
  "state": "archived",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "updated": "2016-07-14T03:23:43Z",
  "updatedBy": "Campaign.updatedBy",
  "userId": 51
}

#Delete a Campaign

DELETE /v1/applications/{applicationId}/campaigns/{campaignId}

Parameters

applicationId integer
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Duplicate the campaign into every specified application

POST /v1/applications/{applicationId}/campaigns/{campaignId}/campaign_duplicate

Duplicate the campaign into every specified application.

Parameters

applicationId integer
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/campaign_duplicate \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "applicationIds": [
    "CampaignDuplicate.applicationIds",
    "CampaignDuplicate.applicationIds"
  ]
}'

Response (200)

{
  "data": [
    {
      "activeRulesetId": 9,
      "applicationId": 85,
      "attributes": {
        "LastOrderDate": "2016-10-08T14:00:58Z",
        "NumberOfSegments": "Travel segments",
        "ReferralPath": "Referral path"
      },
      "couponRedemptionCount": 59,
      "couponSettings": {
        "couponPattern": "ov8nbuuvgx",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "created": "2016-07-23T06:46:06Z",
      "createdBy": "Campaign.createdBy",
      "description": "description",
      "discountCount": 78,
      "endTime": "2018-12-24T15:38:47.939643471Z",
      "features": [
        "referrals",
        "referrals",
        "referrals"
      ],
      "id": 51,
      "lastActivity": "2016-07-24T03:21:34Z",
      "limits": [
        {
          "action": "setDiscount",
          "entities": [
            "Coupon"
          ],
          "limit": 40.53
        }
      ],
      "name": "Now 10% on all 24 month plans",
      "referralRedemptionCount": 45,
      "referralSettings": {
        "couponPattern": "gkb8vayc77",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "startTime": "2018-08-21T15:38:47.939643471Z",
      "state": "archived",
      "tags": [
        "referral",
        "international",
        "labor day"
      ],
      "updated": "2016-07-14T03:23:43Z",
      "updatedBy": "Campaign.updatedBy",
      "userId": 51
    }
  ]
}

#Get a list of all campaigns that match the given attributes

POST /v1/applications/{applicationId}/campaigns_search

Gets a list of all the campaigns that exactly match a set of attributes.

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
campaignState string - Filter results by the state of the campaign.

Request

curl https://example.talon.one/v1/applications/42/campaigns_search \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "Tax": 28
  }
}'

Response (200)

{
  "data": [
    {
      "activeRulesetId": 9,
      "applicationId": 85,
      "attributes": {
        "LastOrderDate": "2016-10-08T14:00:58Z",
        "NumberOfSegments": "Travel segments",
        "ReferralPath": "Referral path"
      },
      "couponRedemptionCount": 59,
      "couponSettings": {
        "couponPattern": "ov8nbuuvgx",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "created": "2016-07-23T06:46:06Z",
      "createdBy": "Campaign.createdBy",
      "description": "description",
      "discountCount": 78,
      "endTime": "2018-12-24T15:38:47.939643471Z",
      "features": [
        "referrals",
        "referrals",
        "referrals"
      ],
      "id": 51,
      "lastActivity": "2016-07-24T03:21:34Z",
      "limits": [
        {
          "action": "setDiscount",
          "entities": [
            "Coupon"
          ],
          "limit": 40.53
        }
      ],
      "name": "Now 10% on all 24 month plans",
      "referralRedemptionCount": 45,
      "referralSettings": {
        "couponPattern": "gkb8vayc77",
        "validCharacters": [
          "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
          "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
        ]
      },
      "startTime": "2018-08-21T15:38:47.939643471Z",
      "state": "archived",
      "tags": [
        "referral",
        "international",
        "labor day"
      ],
      "updated": "2016-07-14T03:23:43Z",
      "updatedBy": "Campaign.updatedBy",
      "userId": 51
    }
  ]
}

#Create a Ruleset

POST /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets

Parameters

applicationId integer
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/rulesets \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "rbVersion": "NewRuleset.rbVersion",
  "rules": [
    {
      "bindings": [
        {
          "expression": [
            "couponValid"
          ],
          "name": ""
        },
        {
          "expression": [
            "setDiscount"
          ],
          "name": "foo"
        }
      ],
      "condition": [
        "couponValid"
      ],
      "description": "Apply discount of 50 when coupon is valid",
      "effects": [
        [
          "setDiscount",
          "foo",
          [
            "+",
            [
              ".|",
              0,
              "Session",
              "Discounts",
              "foo"
            ],
            50
          ]
        ]
      ],
      "title": "Validate 50 off coupon"
    }
  ]
}'

Response (201)

{
  "activatedAt": "2016-05-21T15:35:35Z",
  "campaignId": 74,
  "created": "2016-09-27T20:02:33Z",
  "id": 88,
  "rbVersion": "Ruleset...NewRuleset.rbVersion",
  "rules": [
    {
      "bindings": [
        {
          "expression": [
            "couponValid"
          ],
          "name": ""
        },
        {
          "expression": [
            "setDiscount"
          ],
          "name": "foo"
        }
      ],
      "condition": [
        "couponValid"
      ],
      "description": "Apply discount of 50 when coupon is valid",
      "effects": [
        [
          "setDiscount",
          "foo",
          [
            "+",
            [
              ".|",
              0,
              "Session",
              "Discounts",
              "foo"
            ],
            50
          ]
        ]
      ],
      "title": "Validate 50 off coupon"
    }
  ],
  "userId": 47
}

#List Campaign Rulesets

GET /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets

Parameters

applicationId integer
campaignId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/applications/42/campaigns/42/rulesets \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "activatedAt": "2016-05-21T15:35:35Z",
      "campaignId": 74,
      "created": "2016-09-27T20:02:33Z",
      "id": 88,
      "rbVersion": "Ruleset...NewRuleset.rbVersion",
      "rules": [
        {
          "bindings": [
            {
              "expression": [
                "couponValid"
              ],
              "name": ""
            },
            {
              "expression": [
                "setDiscount"
              ],
              "name": "foo"
            }
          ],
          "condition": [
            "couponValid"
          ],
          "description": "Apply discount of 50 when coupon is valid",
          "effects": [
            [
              "setDiscount",
              "foo",
              [
                "+",
                [
                  ".|",
                  0,
                  "Session",
                  "Discounts",
                  "foo"
                ],
                50
              ]
            ]
          ],
          "title": "Validate 50 off coupon"
        }
      ],
      "userId": 47
    }
  ]
}

#Update a Ruleset

PUT /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

Parameters

applicationId integer
campaignId integer
rulesetId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/rulesets/1234 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "rbVersion": "NewRuleset.rbVersion",
  "rules": [
    {
      "bindings": [
        {
          "expression": [
            "couponValid"
          ],
          "name": ""
        },
        {
          "expression": [
            "setDiscount"
          ],
          "name": "foo"
        }
      ],
      "condition": [
        "couponValid"
      ],
      "description": "Apply discount of 50 when coupon is valid",
      "effects": [
        [
          "setDiscount",
          "foo",
          [
            "+",
            [
              ".|",
              0,
              "Session",
              "Discounts",
              "foo"
            ],
            50
          ]
        ]
      ],
      "title": "Validate 50 off coupon"
    }
  ]
}'

Response (200)

{
  "activatedAt": "2016-05-21T15:35:35Z",
  "campaignId": 74,
  "created": "2016-09-27T20:02:33Z",
  "id": 88,
  "rbVersion": "Ruleset...NewRuleset.rbVersion",
  "rules": [
    {
      "bindings": [
        {
          "expression": [
            "couponValid"
          ],
          "name": ""
        },
        {
          "expression": [
            "setDiscount"
          ],
          "name": "foo"
        }
      ],
      "condition": [
        "couponValid"
      ],
      "description": "Apply discount of 50 when coupon is valid",
      "effects": [
        [
          "setDiscount",
          "foo",
          [
            "+",
            [
              ".|",
              0,
              "Session",
              "Discounts",
              "foo"
            ],
            50
          ]
        ]
      ],
      "title": "Validate 50 off coupon"
    }
  ],
  "userId": 47
}

#Get a Ruleset

GET /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

Parameters

applicationId integer
campaignId integer
rulesetId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/rulesets/1234 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "activatedAt": "2016-05-21T15:35:35Z",
  "campaignId": 74,
  "created": "2016-09-27T20:02:33Z",
  "id": 88,
  "rbVersion": "Ruleset...NewRuleset.rbVersion",
  "rules": [
    {
      "bindings": [
        {
          "expression": [
            "couponValid"
          ],
          "name": ""
        },
        {
          "expression": [
            "setDiscount"
          ],
          "name": "foo"
        }
      ],
      "condition": [
        "couponValid"
      ],
      "description": "Apply discount of 50 when coupon is valid",
      "effects": [
        [
          "setDiscount",
          "foo",
          [
            "+",
            [
              ".|",
              0,
              "Session",
              "Discounts",
              "foo"
            ],
            50
          ]
        ]
      ],
      "title": "Validate 50 off coupon"
    }
  ],
  "userId": 47
}

#Delete a Ruleset

DELETE /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}

Parameters

applicationId integer
campaignId integer
rulesetId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/rulesets/1234 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Coupons

Coupons are unique codes belonging to a particular campaign. They don't define any behaviour on their own, instead the campaign ruleset can include rules that validate coupons and carry out particular effects.

#Create Coupons

POST /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupns can be created.

Parameters

applicationId integer
campaignId integer

Query Parameters

silent string - If set to 'yes', response will be an empty 204, otherwise a list of the coupons generated (to to 1000).

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/coupons \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "PaymentMethod": "Session payment method",
    "ReferralPath": "Referral path",
    "ShippingName": "Session shipping Name",
    "Source": "Source"
  },
  "couponPattern": "vlp3454cjp",
  "expiryDate": "2018-12-31T15:38:47.939643471Z",
  "numberOfCoupons": 33,
  "recipientIntegrationId": "20",
  "startDate": "2018-08-21T15:38:47.939643471Z",
  "uniquePrefix": "NewCoupons.uniquePrefix",
  "usageLimit": 42,
  "validCharacters": [
    "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
    "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
  ]
}'

Response (200)

{
  "data": [
    {
      "attributes": {
        "AdGroup": "Ad Group",
        "BillingPostalCode": "Session billing postal code",
        "ClickedOn": "Clicked on",
        "DepartureCountry": "Departure country"
      },
      "batchId": "Coupon.batchId",
      "campaignId": 23,
      "created": "2016-11-10T08:16:07Z",
      "expiryDate": "2019-02-07T15:38:47.939643471Z",
      "id": 67,
      "importId": 37,
      "recipientIntegrationId": "4",
      "referralId": 82,
      "startDate": "2018-08-21T15:38:47.939643471Z",
      "usageCounter": 70,
      "usageLimit": 73,
      "value": "534frorcav"
    }
  ]
}

#List Coupons

GET /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

Parameters

applicationId integer
campaignId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
couponBatch string - Filter results by batches of coupons
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/coupons \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "attributes": {
        "AdGroup": "Ad Group",
        "BillingPostalCode": "Session billing postal code",
        "ClickedOn": "Clicked on",
        "DepartureCountry": "Departure country"
      },
      "batchId": "Coupon.batchId",
      "campaignId": 23,
      "created": "2016-11-10T08:16:07Z",
      "expiryDate": "2019-02-07T15:38:47.939643471Z",
      "id": 67,
      "importId": 37,
      "recipientIntegrationId": "4",
      "referralId": 82,
      "startDate": "2018-08-21T15:38:47.939643471Z",
      "usageCounter": 70,
      "usageLimit": 73,
      "value": "534frorcav"
    }
  ]
}

#Delete Coupons

DELETE /v1/applications/{applicationId}/campaigns/{campaignId}/coupons

Parameters

applicationId integer
campaignId integer

Query Parameters

value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code

Request

curl https://example.talon.one/v1/applications/42/campaigns/42/coupons \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#List Coupons

GET /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total

Parameters

applicationId integer
campaignId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
couponBatch string - Filter results by batches of coupons
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/coupons/no_total \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "attributes": {
        "AdGroup": "Ad Group",
        "BillingPostalCode": "Session billing postal code",
        "ClickedOn": "Clicked on",
        "DepartureCountry": "Departure country"
      },
      "batchId": "Coupon.batchId",
      "campaignId": 23,
      "created": "2016-11-10T08:16:07Z",
      "expiryDate": "2019-02-07T15:38:47.939643471Z",
      "id": 67,
      "importId": 37,
      "recipientIntegrationId": "4",
      "referralId": 82,
      "startDate": "2018-08-21T15:38:47.939643471Z",
      "usageCounter": 70,
      "usageLimit": 73,
      "value": "534frorcav"
    }
  ]
}

#Update a Coupon

PUT /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}

Parameters

applicationId integer
campaignId integer
couponId string - The ID of the coupon code to update

Request

curl https://example.talon.one/v1/applications/42/campaigns/42/coupons/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "BaggageAllowance": 7,
    "VenueKitchenType": "Venue kitchen type"
  },
  "expiryDate": "2019-01-29T15:38:47.939643471Z",
  "recipientIntegrationId": "87",
  "startDate": "2018-08-21T15:38:47.939643471Z",
  "usageLimit": 97,
  "value": "foms5e1hoj"
}'

Response (200)

{
  "attributes": {
    "AdGroup": "Ad Group",
    "BillingPostalCode": "Session billing postal code",
    "ClickedOn": "Clicked on",
    "DepartureCountry": "Departure country"
  },
  "batchId": "Coupon.batchId",
  "campaignId": 23,
  "created": "2016-11-10T08:16:07Z",
  "expiryDate": "2019-02-07T15:38:47.939643471Z",
  "id": 67,
  "importId": 37,
  "recipientIntegrationId": "4",
  "referralId": 82,
  "startDate": "2018-08-21T15:38:47.939643471Z",
  "usageCounter": 70,
  "usageLimit": 73,
  "value": "534frorcav"
}

#Delete one Coupon

DELETE /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}

Parameters

applicationId integer
campaignId integer
couponId string - The ID of the coupon code to delete

Request

curl https://example.talon.one/v1/applications/42/campaigns/42/coupons/42 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Get a list of the coupons that match the given attributes

POST /v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search

Gets a list of all the coupons that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request.

Parameters

applicationId integer
campaignId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code
couponBatch string - Filter results by batches of coupons

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/coupons_search \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "FlightNumber": "Flight number",
    "ShippingCountry": "Session shipping country"
  }
}'

Response (200)

{
  "data": [
    {
      "attributes": {
        "AdGroup": "Ad Group",
        "BillingPostalCode": "Session billing postal code",
        "ClickedOn": "Clicked on",
        "DepartureCountry": "Departure country"
      },
      "batchId": "Coupon.batchId",
      "campaignId": 23,
      "created": "2016-11-10T08:16:07Z",
      "expiryDate": "2019-02-07T15:38:47.939643471Z",
      "id": 67,
      "importId": 37,
      "recipientIntegrationId": "4",
      "referralId": 82,
      "startDate": "2018-08-21T15:38:47.939643471Z",
      "usageCounter": 70,
      "usageLimit": 73,
      "value": "534frorcav"
    }
  ]
}

#Get a list of the coupons that match the given attributes in all active campaigns of an application

POST /v1/applications/{applicationId}/coupons_search

Gets a list of all the coupons that exactly match a set of attributes from all campaigns that are currently active.

The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request.

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
couponBatch string - Filter results by batches of coupons
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code
campaignState string - Filter results by the state of the campaign.

Request

curl https://example.talon.one/v1/applications/42/coupons_search \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "FlightNumber": "Flight number",
    "ShippingCountry": "Session shipping country"
  }
}'

Response (200)

{
  "data": [
    {
      "attributes": {
        "AdGroup": "Ad Group",
        "BillingPostalCode": "Session billing postal code",
        "ClickedOn": "Clicked on",
        "DepartureCountry": "Departure country"
      },
      "batchId": "Coupon.batchId",
      "campaignId": 23,
      "created": "2016-11-10T08:16:07Z",
      "expiryDate": "2019-02-07T15:38:47.939643471Z",
      "id": 67,
      "importId": 37,
      "recipientIntegrationId": "4",
      "referralId": 82,
      "startDate": "2018-08-21T15:38:47.939643471Z",
      "usageCounter": 70,
      "usageLimit": 73,
      "value": "534frorcav"
    }
  ]
}

#Import coupons via CSV file.

POST /v1/applications/{applicationId}/campaigns/{campaignId}/import_coupons

"Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data."

Parameters

applicationId integer - The identifier for the application
campaignId integer

Request

curl https://example.talon.one/v1/applications/42/campaigns/97/import_coupons \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accountId": 73,
  "created": "2016-10-13T20:47:52Z",
  "entity": "Coupon",
  "filter": {},
  "id": 56,
  "userId": 67
}

#Export Coupons to a CSV file.

GET /v1/applications/{applicationId}/export_coupons

Download a file with the coupons that match the given attributes.

Parameters

applicationId integer - The identifier for the application

Query Parameters

campaignId int - Filter results by campaign.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
value string - Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters.
createdBefore string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
createdAfter string - Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp.
valid string - Either "expired", "validNow", or "validFuture". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future.
usable - Either "true" or "false". If "true", only coupons where `usageCounter < usageLimit` will be returned, "false" will return only coupons where `usageCounter >= usageLimit`.
referralId integer - Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code.
recipientIntegrationId string - Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field
couponBatch string - Filter results by the batch the coupons belong to
exactMatch bool - Filter results to an exact case-insensitive matching against the coupon code
dateFormat string - Determines the format of dates in the export document.
campaignState string - Filter results by the state of the campaign.

Request

curl https://example.talon.one/v1/applications/42/export_coupons \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{}

#Campaign Analytics

Campaign Analytics are used to retrieve statistical data about the performance of a specific campaign.

#Get analytics of campaigns

GET /v1/applications/{applicationId}/campaigns/{campaignId}/analytics

Parameters

applicationId integer
campaignId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
rangeStart string (required) - Only return results from after this timestamp, must be an RFC3339 timestamp string
rangeEnd string (required) - Only return results from before this timestamp, must be an RFC3339 timestamp string

Request

curl https://example.talon.one/v1/applications/42/campaigns/42/analytics \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "campaignId": 99,
      "campaignRedemptionLimit": 54,
      "campaignRedemptionsRemaining": 84,
      "couponDiscountCosts": 21.65,
      "couponRedemptionLimit": 23,
      "couponRedemptions": 71,
      "couponRedemptionsRemaining": 41,
      "couponRevenue": 99.06,
      "couponsCount": 72,
      "created": "2016-09-27T21:46:53Z",
      "id": 73,
      "revenuePerRedemption": 91.56,
      "unlimitedCoupons": 96
    }
  ]
}

#Customer Data

Customer Data operations are used to retrieve data about customers/sessions/events for reporting and debugging in the Campaign Manager.

#List Application Customers

GET /v1/applications/{applicationId}/customers

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42/customers \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "accountId": 73,
      "attributes": {
        "Language": "Session language",
        "OS": "Operating system",
        "Source": "Source"
      },
      "closedSessions": 25,
      "created": "2016-10-24T00:45:27Z",
      "id": 52,
      "integrationId": "NewCustomerProfile32",
      "lastActivity": "2016-03-12T17:08:02Z",
      "loyaltyMemberships": [
        {
          "joined": "2016-02-20T19:22:19Z",
          "loyaltyProgramId": 88
        },
        {
          "joined": "2016-07-19T10:29:14Z",
          "loyaltyProgramId": 9
        },
        {
          "joined": "2016-06-16T07:09:57Z",
          "loyaltyProgramId": 76
        }
      ],
      "totalSales": 65.7
    }
  ]
}

#Get a list of the customer profiles that match the given attributes

POST /v1/application_customer_search

Gets a list of all the cusomer profiles for the account that exactly match a set of attributes.

The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request.

Request

curl https://example.talon.one/v1/application_customer_search \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "attributes": {
    "FlightNumber": "Flight number",
    "ScreenResolution": "Screen resolution",
    "ShippingAddress2": "Default shipping address field 2",
    "ShippingSalutation": "Default shipping salutation"
  },
  "integrationIDs": [
    "ApplicationCustomerSearch.integrationIDs"
  ],
  "profileIDs": [
    42,
    30,
    26,
    33
  ]
}'

Response (200)

{
  "data": [
    {
      "accountId": 73,
      "attributes": {
        "Language": "Session language",
        "OS": "Operating system",
        "Source": "Source"
      },
      "closedSessions": 25,
      "created": "2016-10-24T00:45:27Z",
      "id": 52,
      "integrationId": "NewCustomerProfile32",
      "lastActivity": "2016-03-12T17:08:02Z",
      "loyaltyMemberships": [
        {
          "joined": "2016-02-20T19:22:19Z",
          "loyaltyProgramId": 88
        },
        {
          "joined": "2016-07-19T10:29:14Z",
          "loyaltyProgramId": 9
        },
        {
          "joined": "2016-06-16T07:09:57Z",
          "loyaltyProgramId": 76
        }
      ],
      "totalSales": 65.7
    }
  ]
}

#Get Application Customer

GET /v1/applications/{applicationId}/customers/{customerId}

Parameters

applicationId integer
customerId integer

Request

curl https://example.talon.one/v1/applications/42/customers/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accountId": 73,
  "attributes": {
    "Language": "Session language",
    "OS": "Operating system",
    "Source": "Source"
  },
  "closedSessions": 25,
  "created": "2016-10-24T00:45:27Z",
  "id": 52,
  "integrationId": "NewCustomerProfile32",
  "lastActivity": "2016-03-12T17:08:02Z",
  "loyaltyMemberships": [
    {
      "joined": "2016-02-20T19:22:19Z",
      "loyaltyProgramId": 88
    },
    {
      "joined": "2016-07-19T10:29:14Z",
      "loyaltyProgramId": 9
    },
    {
      "joined": "2016-06-16T07:09:57Z",
      "loyaltyProgramId": 76
    }
  ],
  "totalSales": 65.7
}

#Get Activity Reports for Application Customers

GET /v1/applications/{applicationId}/customer_activity_reports

Fetch summary reports for all application customers based on a time range

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
rangeStart string (required) - Only return results from after this timestamp, must be an RFC3339 timestamp string
rangeEnd string (required) - Only return results from before this timestamp, must be an RFC3339 timestamp string
name string - Only return reports matching the customer name
integrationId string - Only return reports matching the integrationId
campaignName string - Only return reports matching the campaignName
advocateName string - Only return reports matching the current customer referrer name

Request

curl https://example.talon.one/v1/applications/42/customer_activity_reports \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "accruedDiscounts": 40.62,
      "accruedRevenue": 81.77,
      "campaignName": "CustomerActivityReport.campaignName",
      "couponFailedAttempts": 84,
      "couponRedemptions": 95,
      "couponUseAttempts": 9,
      "created": "2016-07-15T23:34:06Z",
      "customerId": 51,
      "integrationId": "NewCustomerProfile32",
      "lastActivity": "2016-07-22T22:52:13Z",
      "name": "Genevieve Corkery",
      "totalOrders": 53,
      "totalOrdersNoCoupon": 72
    }
  ]
}

#Get Activity Report for Single Customer

GET /v1/applications/{applicationId}/customer_activity_reports/{customerId}

Fetch summary report for single application customer based on a time range

Parameters

applicationId integer
customerId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
rangeStart string (required) - Only return results from after this timestamp, must be an RFC3339 timestamp string
rangeEnd string (required) - Only return results from before this timestamp, must be an RFC3339 timestamp string

Request

curl https://example.talon.one/v1/applications/42/customer_activity_reports/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accruedDiscounts": 40.62,
  "accruedRevenue": 81.77,
  "campaignName": "CustomerActivityReport.campaignName",
  "couponFailedAttempts": 84,
  "couponRedemptions": 95,
  "couponUseAttempts": 9,
  "created": "2016-07-15T23:34:06Z",
  "customerId": 51,
  "integrationId": "NewCustomerProfile32",
  "lastActivity": "2016-07-22T22:52:13Z",
  "name": "Genevieve Corkery",
  "totalOrders": 53,
  "totalOrdersNoCoupon": 72
}

#List Application Sessions

GET /v1/applications/{applicationId}/sessions

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
profile string - Profile integration ID filter for sessions. Must be exact match.

Request

curl https://example.talon.one/v1/applications/42/sessions \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationId": 39,
      "attributes": {
        "BaggageAllowance": 52,
        "LandingPage": "Landing page"
      },
      "cartItems": [
        {
          "adjustment": {
            "payFromLoyaltyProgram": 93,
            "pointPayment": 28,
            "remainingPrice": 41.64
          },
          "attributes": {
            "FrequentFlyerId": "Frequent flyer ID",
            "PassengerSegment": "Travel passenger segment",
            "ScreenResolution": "Screen resolution",
            "URL": "Customer's URL"
          },
          "category": "food",
          "height": 2.32,
          "length": 6.27,
          "name": "3 month plan",
          "position": 84.38,
          "price": 3.54,
          "quantity": 48,
          "sku": "lsxn838awe",
          "weight": 3.89,
          "width": 6.84
        },
        {
          "adjustment": {
            "payFromLoyaltyProgram": 29,
            "pointPayment": 43,
            "remainingPrice": 33.07
          },
          "attributes": {
            "BillingName": "Session billing name",
            "PageVisited": "Page visited",
            "ShippingAddress2": "Default shipping address field 2",
            "VenueMealType": 80
          },
          "category": "food",
          "height": 2.82,
          "length": 4.68,
          "name": "3 month plan",
          "position": 29.08,
          "price": 35.26,
          "quantity": 36,
          "sku": "kykl348rlr",
          "weight": 6.16,
          "width": 4.32
        },
        {
          "adjustment": {
            "payFromLoyaltyProgram": 55,
            "pointPayment": 42,
            "remainingPrice": 92.17
          },
          "attributes": {
            "Pagetitle": "Page title",
            "PaymentIdHash": "Default payment id hash"
          },
          "category": "food",
          "height": 4.05,
          "length": 3.05,
          "name": "spatula",
          "position": 5.66,
          "price": 66.26,
          "quantity": 65,
          "sku": "fvsy140hfm",
          "weight": 4.87,
          "width": 3.83
        }
      ],
      "coupon": "r8ut5r8n1w",
      "created": "2016-01-26T11:19:23Z",
      "discounts": {
        "cheapest item": 8,
        "free item": 1
      },
      "id": 96,
      "integrationId": "NewCustomerProfile32",
      "profileId": 54,
      "referral": "wn0n8x6vh9",
      "state": "cancelled"
    }
  ]
}

#Get Application Session

GET /v1/applications/{applicationId}/sessions/{sessionId}

Parameters

applicationId integer
sessionId integer

Request

curl https://example.talon.one/v1/applications/42/sessions/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "applicationId": 39,
  "attributes": {
    "BaggageAllowance": 52,
    "LandingPage": "Landing page"
  },
  "cartItems": [
    {
      "adjustment": {
        "payFromLoyaltyProgram": 93,
        "pointPayment": 28,
        "remainingPrice": 41.64
      },
      "attributes": {
        "FrequentFlyerId": "Frequent flyer ID",
        "PassengerSegment": "Travel passenger segment",
        "ScreenResolution": "Screen resolution",
        "URL": "Customer's URL"
      },
      "category": "food",
      "height": 2.32,
      "length": 6.27,
      "name": "3 month plan",
      "position": 84.38,
      "price": 3.54,
      "quantity": 48,
      "sku": "lsxn838awe",
      "weight": 3.89,
      "width": 6.84
    },
    {
      "adjustment": {
        "payFromLoyaltyProgram": 29,
        "pointPayment": 43,
        "remainingPrice": 33.07
      },
      "attributes": {
        "BillingName": "Session billing name",
        "PageVisited": "Page visited",
        "ShippingAddress2": "Default shipping address field 2",
        "VenueMealType": 80
      },
      "category": "food",
      "height": 2.82,
      "length": 4.68,
      "name": "3 month plan",
      "position": 29.08,
      "price": 35.26,
      "quantity": 36,
      "sku": "kykl348rlr",
      "weight": 6.16,
      "width": 4.32
    },
    {
      "adjustment": {
        "payFromLoyaltyProgram": 55,
        "pointPayment": 42,
        "remainingPrice": 92.17
      },
      "attributes": {
        "Pagetitle": "Page title",
        "PaymentIdHash": "Default payment id hash"
      },
      "category": "food",
      "height": 4.05,
      "length": 3.05,
      "name": "spatula",
      "position": 5.66,
      "price": 66.26,
      "quantity": 65,
      "sku": "fvsy140hfm",
      "weight": 4.87,
      "width": 3.83
    }
  ],
  "coupon": "r8ut5r8n1w",
  "created": "2016-01-26T11:19:23Z",
  "discounts": {
    "cheapest item": 8,
    "free item": 1
  },
  "id": 96,
  "integrationId": "NewCustomerProfile32",
  "profileId": 54,
  "referral": "wn0n8x6vh9",
  "state": "cancelled"
}

#List Applications Events

GET /v1/applications/{applicationId}/events

Lists all events recorded for an application.

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
type string - Comma-separated list of types by which to filter events. Must be exact match(es).
createdBefore string - Only return events created before this date
createdAfter string - Only return events created after this date
session string - Session integration ID filter for events. Must be exact match.
profile string - Profile integration ID filter for events. Must be exact match.
customerName string - Customer name filter for events. Will match substrings case-insensitively.
customerEmail string - Customer e-mail address filter for events. Will match substrings case-insensitively.
effectsQuery string - Effects filter for events. Will perform a full-text search on the text content of the events effects, if any.
attributesQuery string - Attributes filter for events. Will perform a full-text search on the text content of the events attributes, both keys and values.
ruleQuery string - Rule name filter for events
campaignQuery string - Campaign name filter for events

Request

curl https://example.talon.one/v1/applications/42/events \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationId": 6,
      "attributes": {
        "ShippingCity": "Session shipping city"
      },
      "created": "2016-10-23T10:52:16Z",
      "effects": [
        "createCampaign",
        "rejectCoupon",
        "put"
      ],
      "id": 20,
      "profileId": 74,
      "sessionId": 67,
      "type": "talon_session_created"
    }
  ]
}

#List Applications Events

GET /v1/applications/{applicationId}/events/no_total

Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only if there are more results. Use this when encountering performance issues

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
type string - Comma-separated list of types by which to filter events. Must be exact match(es).
createdBefore string - Only return events created before this date
createdAfter string - Only return events created after this date
session string - Session integration ID filter for events. Must be exact match.
profile string - Profile integration ID filter for events. Must be exact match.
customerName string - Customer name filter for events. Will match substrings case-insensitively.
customerEmail string - Customer e-mail address filter for events. Will match substrings case-insensitively.
effectsQuery string - Effects filter for events. Will perform a full-text search on the text content of the events effects, if any.
attributesQuery string - Attributes filter for events. Will perform a full-text search on the text content of the events attributes, both keys and values.
ruleQuery string - Rule name filter for events
campaignQuery string - Campaign name filter for events

Request

curl https://example.talon.one/v1/applications/42/events/no_total \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationId": 6,
      "attributes": {
        "ShippingCity": "Session shipping city"
      },
      "created": "2016-10-23T10:52:16Z",
      "effects": [
        "createCampaign",
        "rejectCoupon",
        "put"
      ],
      "id": 20,
      "profileId": 74,
      "sessionId": 67,
      "type": "talon_session_created"
    }
  ]
}

#List Applications Event Types

GET /v1/applications/{applicationId}/event_types

Get all of the distinct values of the Event type property for events recorded in the application.

See also: Track an event

Parameters

applicationId integer

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/applications/42/event_types \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    "ApplicationEventType"
  ]
}

#Customization

Talon.One is extremely customizable. These API operations allow you to alter the data model and rule builder to better suit Talon.One to the needs of your business.

#Get Talang Environment

GET /v1/applications/{applicationId}/talang_environment

Parameters

applicationId integer

Request

curl https://example.talon.one/v1/applications/42/talang_environment \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{}

#Update a custom Talang template

PUT /v1/applications/{applicationId}/talang_templates/{name}

This operation allows developers to create & update custom templates for rules, conditions, and effects. These custom templates are available to campaign managers in the sidebar of the campaign rule editor.

Parameters

applicationId integer
name string - The name of the template. This is used in the Talang expressions of rules.

Request

curl https://example.talon.one/v1/applications/42/talang_templates/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d 'undefined'

Response (200)

{}

#Delete a custom Talang template

DELETE /v1/applications/{applicationId}/talang_templates/{name}

Delete a custom Talang template. Warning: this operation does not check if the template is in use by any rules.

Parameters

applicationId integer
name string - The name of the template. This is used in the Talang expressions of rules.

Request

curl https://example.talon.one/v1/applications/42/talang_templates/42 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Get the library of attributes

GET /v1/attributes_library

Returns all the attributes in the library

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/attributes_library \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "description": "Total number of orders placed by customer.",
      "entity": "CustomerProfile",
      "name": "TotalOrders",
      "presets": [
        "User"
      ],
      "tags": [
        "Sum of orders",
        "Number of orders"
      ],
      "title": "Total orders",
      "type": "number"
    }
  ]
}

#Define a new custom attribute

POST /v1/attributes

Defines a new custom attribute in this account. Custom attributes allow you to attach new fields to Talon.One domain objects like campaigns, coupons, customers and so on. These attributes can then be given values when creating / updating these objects, and these values can be used in your campaign rules. For example, you could define a zipCode field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes.

These attributes are shared across all applications in your account, and are never required.

Request

curl https://example.talon.one/v1/attributes \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "description": "description",
  "editable": true,
  "entity": "Coupon",
  "eventType": "NewAttribute.eventType",
  "name": "new attribute Talang call",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "title": "new attribute name",
  "type": "string"
}'

Response (201)

{
  "accountId": 89,
  "created": "2016-10-09T08:28:30Z",
  "description": "description",
  "editable": true,
  "entity": "Coupon",
  "eventType": "Attribute...NewAttribute.eventType",
  "id": 19,
  "lastUsed": "2016-07-11T15:03:49Z",
  "lastUsedApplicationId": 11,
  "lastUsedRequestUuid": "9566c74d10034c4dbbbb0407d1e2c649",
  "locked": true,
  "modified": "2016-01-06T08:53:13Z",
  "name": "new attribute Talang call",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "title": "new attribute name",
  "type": "(list string)",
  "usedAt": []
}

#List custom attributes

GET /v1/attributes

Returns all the defined custom attributes for the account.

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/attributes \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "accountId": 89,
      "created": "2016-10-09T08:28:30Z",
      "description": "description",
      "editable": true,
      "entity": "Coupon",
      "eventType": "Attribute...NewAttribute.eventType",
      "id": 19,
      "lastUsed": "2016-07-11T15:03:49Z",
      "lastUsedApplicationId": 11,
      "lastUsedRequestUuid": "9566c74d10034c4dbbbb0407d1e2c649",
      "locked": true,
      "modified": "2016-01-06T08:53:13Z",
      "name": "new attribute Talang call",
      "tags": [
        "referral",
        "international",
        "labor day"
      ],
      "title": "new attribute name",
      "type": "(list string)",
      "usedAt": []
    }
  ]
}

#Get a custom attribute

GET /v1/attributes/{attributeId}

Returns custom attribute for the account by its id.

Parameters

attributeId integer

Request

curl https://example.talon.one/v1/attributes/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accountId": 89,
  "created": "2016-10-09T08:28:30Z",
  "description": "description",
  "editable": true,
  "entity": "Coupon",
  "eventType": "Attribute...NewAttribute.eventType",
  "id": 19,
  "lastUsed": "2016-07-11T15:03:49Z",
  "lastUsedApplicationId": 11,
  "lastUsedRequestUuid": "9566c74d10034c4dbbbb0407d1e2c649",
  "locked": true,
  "modified": "2016-01-06T08:53:13Z",
  "name": "new attribute Talang call",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "title": "new attribute name",
  "type": "(list string)",
  "usedAt": []
}

#Update a custom attribute

PUT /v1/attributes/{attributeId}

Updates an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the title (human readable description). This restriction is in place to prevent accidentally breaking live integrations. E.g. if you have a customer profile attribute with the name region, and your integration is sending attributes.region with customer profile updates, changing the name to locale would cause the integration requests to begin failing.

If you really need to change the type or name property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. Then delete the old attribute when you are confident you have migrated any needed data from the old attribute to the new one.

Parameters

attributeId integer

Request

curl https://example.talon.one/v1/attributes/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "description": "description",
  "editable": true,
  "entity": "Coupon",
  "eventType": "NewAttribute.eventType",
  "name": "new attribute Talang call",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "title": "new attribute name",
  "type": "string"
}'

Response (200)

{
  "accountId": 89,
  "created": "2016-10-09T08:28:30Z",
  "description": "description",
  "editable": true,
  "entity": "Coupon",
  "eventType": "Attribute...NewAttribute.eventType",
  "id": 19,
  "lastUsed": "2016-07-11T15:03:49Z",
  "lastUsedApplicationId": 11,
  "lastUsedRequestUuid": "9566c74d10034c4dbbbb0407d1e2c649",
  "locked": true,
  "modified": "2016-01-06T08:53:13Z",
  "name": "new attribute Talang call",
  "tags": [
    "referral",
    "international",
    "labor day"
  ],
  "title": "new attribute name",
  "type": "(list string)",
  "usedAt": []
}

#Delete a custom attribute

DELETE /v1/attributes/{attributeId}

Removes a defined custom attribute.

Warning: this will also destroy all data associated with the attribute!

Parameters

attributeId integer

Request

curl https://example.talon.one/v1/attributes/42 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#List Webhooks

GET /v1/webhooks

Query Parameters

applicationIds string - Filter by one or more application ids separated by comma
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.

Request

curl https://example.talon.one/v1/webhooks \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationIds": [
        2,
        85
      ],
      "created": "2016-05-16T08:52:01Z",
      "enabled": false,
      "headers": [
        "Content-Type",
        "Content-Signature"
      ],
      "id": 75,
      "modified": "2016-10-08T19:39:18Z",
      "params": [
        {
          "description": "description",
          "title": "Webhook...NewWebhook.params...TemplateArgDef.title",
          "type": "boolean",
          "ui": {}
        }
      ],
      "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
      "title": "Thank-you-Email",
      "url": "http://harris.biz/mabel",
      "usedAt": [
        "Webhook.usedAt",
        "Webhook.usedAt",
        "Webhook.usedAt"
      ],
      "verb": "GET"
    }
  ]
}

#Create Webhook

POST /v1/webhooks

Creates a new webhook.

Request

curl https://example.talon.one/v1/webhooks \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "applicationIds": [
    4,
    2,
    44,
    24
  ],
  "enabled": false,
  "headers": [
    "Content-Type",
    "Content-Signature"
  ],
  "params": [
    {
      "description": "description",
      "title": "NewWebhook.params...TemplateArgDef.title",
      "type": "number",
      "ui": {}
    }
  ],
  "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
  "title": "Thank-you-Email",
  "url": "http://harris.biz/mabel",
  "verb": "DELETE"
}'

Response (200)

{
  "applicationIds": [
    2,
    85
  ],
  "created": "2016-05-16T08:52:01Z",
  "enabled": false,
  "headers": [
    "Content-Type",
    "Content-Signature"
  ],
  "id": 75,
  "modified": "2016-10-08T19:39:18Z",
  "params": [
    {
      "description": "description",
      "title": "Webhook...NewWebhook.params...TemplateArgDef.title",
      "type": "boolean",
      "ui": {}
    }
  ],
  "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
  "title": "Thank-you-Email",
  "url": "http://harris.biz/mabel",
  "usedAt": [
    "Webhook.usedAt",
    "Webhook.usedAt",
    "Webhook.usedAt"
  ],
  "verb": "GET"
}

#Get Webhook

GET /v1/webhooks/{webhookId}

Returns an webhook by its id.

Parameters

webhookId integer

Request

curl https://example.talon.one/v1/webhooks/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "applicationIds": [
    2,
    85
  ],
  "created": "2016-05-16T08:52:01Z",
  "enabled": false,
  "headers": [
    "Content-Type",
    "Content-Signature"
  ],
  "id": 75,
  "modified": "2016-10-08T19:39:18Z",
  "params": [
    {
      "description": "description",
      "title": "Webhook...NewWebhook.params...TemplateArgDef.title",
      "type": "boolean",
      "ui": {}
    }
  ],
  "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
  "title": "Thank-you-Email",
  "url": "http://harris.biz/mabel",
  "usedAt": [
    "Webhook.usedAt",
    "Webhook.usedAt",
    "Webhook.usedAt"
  ],
  "verb": "GET"
}

#Update Webhook

PUT /v1/webhooks/{webhookId}

Updates an existing webhook.

Parameters

webhookId integer

Request

curl https://example.talon.one/v1/webhooks/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "applicationIds": [
    2,
    85
  ],
  "created": "2016-05-16T08:52:01Z",
  "enabled": false,
  "headers": [
    "Content-Type",
    "Content-Signature"
  ],
  "id": 75,
  "modified": "2016-10-08T19:39:18Z",
  "params": [
    {
      "description": "description",
      "title": "Webhook...NewWebhook.params...TemplateArgDef.title",
      "type": "boolean",
      "ui": {}
    }
  ],
  "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
  "title": "Thank-you-Email",
  "url": "http://harris.biz/mabel",
  "usedAt": [
    "Webhook.usedAt",
    "Webhook.usedAt",
    "Webhook.usedAt"
  ],
  "verb": "GET"
}'

Response (200)

{
  "applicationIds": [
    2,
    85
  ],
  "created": "2016-05-16T08:52:01Z",
  "enabled": false,
  "headers": [
    "Content-Type",
    "Content-Signature"
  ],
  "id": 75,
  "modified": "2016-10-08T19:39:18Z",
  "params": [
    {
      "description": "description",
      "title": "Webhook...NewWebhook.params...TemplateArgDef.title",
      "type": "boolean",
      "ui": {}
    }
  ],
  "payload": "{Name: ${$Profile.Attributes.Name}, Email: ${$Profile.Attributes.Email}}",
  "title": "Thank-you-Email",
  "url": "http://harris.biz/mabel",
  "usedAt": [
    "Webhook.usedAt",
    "Webhook.usedAt",
    "Webhook.usedAt"
  ],
  "verb": "GET"
}

#Delete Webhook

DELETE /v1/webhooks/{webhookId}

Removes an existing webhook.

Parameters

webhookId integer

Request

curl https://example.talon.one/v1/webhooks/42 \
 -X DELETE \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (204)

{}

#Logs

The Talon.One API records all incoming and outgoing requests. These API operations allow you to query those logs.

#Get access logs for application

GET /v1/applications/{applicationId}/access_logs

Parameters

applicationId integer

Query Parameters

path string - Only return results where the request path matches the given regular expresssion.
method string - Only return results where the request method matches the given regular expresssion.
status string - Filter results by HTTP status codes.
rangeStart string (required) - Only return results from after this timestamp, must be an RFC3339 timestamp string
rangeEnd string (required) - Only return results from before this timestamp, must be an RFC3339 timestamp string
pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/applications/42/access_logs \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "method": "GET",
      "requestPayload": "information in a payload sent with a request",
      "requestUri": "https://wolf.name/",
      "responsePayload": "information in a payload sent with a response",
      "status": 67,
      "time": "2016-04-01T09:46:43Z",
      "uuid": "52fdfc072182454f963f5f0f9a621d72"
    }
  ]
}

#Get all access logs

GET /v1/access_logs

Fetches the access logs for the entire account. Sensitive requests (logins) are always filtered from the logs.

Query Parameters

rangeStart string (required) - Only return results from after this timestamp, must be an RFC3339 timestamp string
rangeEnd string (required) - Only return results from before this timestamp, must be an RFC3339 timestamp string
path string - Only return results where the request path matches the given regular expresssion.
method string - Only return results where the request method matches the given regular expresssion.
status string - Filter results by HTTP status codes.
pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/access_logs \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "method": "GET",
      "requestPayload": "information in a payload sent with a request",
      "requestUri": "https://wolf.name/",
      "responsePayload": "information in a payload sent with a response",
      "status": 67,
      "time": "2016-04-01T09:46:43Z",
      "uuid": "52fdfc072182454f963f5f0f9a621d72"
    }
  ]
}

#List Webhook activation Log Entries

GET /v1/webhook_activation_logs

Webhook activation log entries would be created as soon as an integration request triggered an effect with a webhook

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
integrationRequestUuid string - Filter results by integration request UUID.
webhookId int - Filter results by Webhook.
applicationId int
campaignId int - Filter results by campaign.
createdBefore string - Only return events created before this date.
createdAfter string - Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string.

Request

curl https://example.talon.one/v1/webhook_activation_logs \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationId": 16,
      "campaignId": 93,
      "created": "2016-09-03T14:46:33Z",
      "integrationRequestUuid": "6694d2c422ac4208a0072939487f6999",
      "webhookId": 22
    }
  ]
}

#List Webhook Log Entries

GET /v1/webhook_logs

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.
status string - Filter results by HTTP status codes.
webhookId int - Filter results by Webhook.
applicationId int
campaignId int - Filter results by campaign.
requestUuid string - Filter results by request UUID.
createdBefore string - Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string.
createdAfter string - Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string.

Request

curl https://example.talon.one/v1/webhook_logs \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "applicationId": 8,
      "id": "23",
      "integrationRequestUuid": "81855ad8681d4d8691e91e00167939cb",
      "request": "WebhookLogEntry.request",
      "requestTime": "2018-08-21T15:38:47.939643471Z",
      "response": "WebhookLogEntry.response",
      "responseTime": "2018-11-08T15:38:47.939643471Z",
      "status": 56,
      "url": "http://harris.biz/mabel",
      "webhookId": 50
    }
  ]
}

#Accounts & Users

Operations for updating account information such as billing email addresses, inviting users, etc.

#List Users in your account

GET /v1/users

Retrieve all users in your account.

Query Parameters

pageSize integer - The number of items to include in this response. When omitted, the maximum value of 1000 will be used.
skip integer - Skips the given number of items when paging through large result sets.
sort string - The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order.

Request

curl https://example.talon.one/v1/users \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "data": [
    {
      "accountId": 77,
      "created": "2016-06-22T23:15:45Z",
      "email": "bertrand_hauck@boyle.name",
      "id": 3,
      "inviteToken": "q8l8o3ovkq",
      "lastActivity": "2016-01-12T18:02:04Z",
      "modified": "2016-05-19T03:38:01Z",
      "name": "Mafalda Predovic",
      "policy": {
        "account_1": "admin",
        "shop_3": "read"
      },
      "releaseUpdate": false,
      "state": "active"
    }
  ]
}

#Get a single User

GET /v1/users/{userId}

Retrieves the data (including an invitation code) for a user. Non-admin users can only get themselves.

Parameters

userId integer

Request

curl https://example.talon.one/v1/users/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "accountId": 77,
  "created": "2016-06-22T23:15:45Z",
  "email": "bertrand_hauck@boyle.name",
  "id": 3,
  "inviteToken": "q8l8o3ovkq",
  "lastActivity": "2016-01-12T18:02:04Z",
  "modified": "2016-05-19T03:38:01Z",
  "name": "Mafalda Predovic",
  "policy": {
    "account_1": "admin",
    "shop_3": "read"
  },
  "releaseUpdate": false,
  "state": "active"
}

#Update User data

PUT /v1/users/{userId}

Parameters

userId integer

Request

curl https://example.talon.one/v1/users/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "email": "lennie_ernser@ankunding.org",
  "name": "Estel Swift",
  "newPassword": "h1xxs4exkz",
  "password": "nqnfuzpila",
  "policy": {
    "account_1": "admin",
    "shop_3": "read"
  },
  "releaseUpdate": true,
  "state": "deactivated"
}'

Response (200)

{
  "accountId": 77,
  "created": "2016-06-22T23:15:45Z",
  "email": "bertrand_hauck@boyle.name",
  "id": 3,
  "inviteToken": "q8l8o3ovkq",
  "lastActivity": "2016-01-12T18:02:04Z",
  "modified": "2016-05-19T03:38:01Z",
  "name": "Mafalda Predovic",
  "policy": {
    "account_1": "admin",
    "shop_3": "read"
  },
  "releaseUpdate": false,
  "state": "active"
}

#Invite a new user to your account

POST /v1/invites

Creates a new invitation within your account. To trigger sending of an invitation email, use the createInviteEmail operation below.

Request

curl https://example.talon.one/v1/invites \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "acl": {
    "account_1": "admin",
    "shop_3": "read"
  },
  "email": "orval.lind@moen.org",
  "name": "Marina Smith"
}'

Response (201)

{
  "accountId": 77,
  "created": "2016-06-22T23:15:45Z",
  "email": "bertrand_hauck@boyle.name",
  "id": 3,
  "inviteToken": "q8l8o3ovkq",
  "lastActivity": "2016-01-12T18:02:04Z",
  "modified": "2016-05-19T03:38:01Z",
  "name": "Mafalda Predovic",
  "policy": {
    "account_1": "admin",
    "shop_3": "read"
  },
  "releaseUpdate": false,
  "state": "active"
}

#(Re)send an invitation email

POST /v1/invite_emails

Given a token & email address, send an invitation email.

Request

curl https://example.talon.one/v1/invite_emails \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "email": "sterling@thompsonlittle.org",
  "token": "9q5jjfpo7j"
}'

Response (201)

{
  "email": "sterling@thompsonlittle.org",
  "token": "9q5jjfpo7j"
}

#Accept an invitation

POST /v1/accept_invite

Consumes the supplied invitation code and creates a new user with the given email & password. The email provided here does not need to match the one used to create the invitation code. (That is, users can choose an alternate email address when accepting an invite).

Request

curl https://example.talon.one/v1/accept_invite \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "email": "barbara.weissnat@maggio.name",
  "inviteToken": "wg8i59gl5f",
  "name": "Antwan Blanda",
  "password": "lwv8w0z81a"
}'

Response (201)

{
  "created": "2016-11-23T23:29:45Z",
  "token": "uggiyt0t1y",
  "userId": 97
}

#Request a password reset

POST /v1/password_recovery_emails

Sends an email with a password recovery link to the email of an existing account.

Request

curl https://example.talon.one/v1/password_recovery_emails \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "email": "larue@hermann.info"
}'

Response (204)

{
  "email": "larue@hermann.info"
}

#Reset password

POST /v1/reset_password

Consumes the supplied password reset token and updates the password for the associated account.

Request

curl https://example.talon.one/v1/reset_password \
 -X POST \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "password": "blqjdzc2vg",
  "resetToken": "njo07hqrsg"
}'

Response (204)

{
  "password": "blqjdzc2vg",
  "resetToken": "njo07hqrsg"
}

#Get Account Details

GET /v1/accounts/{accountId}

Return the details of your companies Talon.One account.

Parameters

accountId integer

Request

curl https://example.talon.one/v1/accounts/42 \
 -H "authorization: Bearer $YOUR_TOKEN"

Response (200)

{
  "apiLimit": 91,
  "applicationCount": 1,
  "applicationLimit": 73,
  "billingEmail": "lulu_kuhn@wiegand.biz",
  "campaignLimit": 29,
  "campaignsActiveCount": 75,
  "campaignsInactiveCount": 7,
  "companyName": "Labadie, Jacobs and Swift",
  "created": "2016-02-01T08:38:30Z",
  "domainName": "KossGroup.talon.one",
  "id": 69,
  "modified": "2016-05-25T05:24:28Z",
  "planExpires": "2016-10-20T13:47:31Z",
  "planName": "booked plan name",
  "state": "trial_expired",
  "userCount": 4,
  "userLimit": 1
}

#Update Account

PUT /v1/accounts/{accountId}

Update the details of your companies Talon.One account. The fields below are the only ones that accept updates via the API.

Parameters

accountId integer

Request

curl https://example.talon.one/v1/accounts/42 \
 -X PUT \
 -H "authorization: Bearer $YOUR_TOKEN" \
 -d '{
  "billingEmail": "shane@bernier.org",
  "companyName": "Labadie, Jacobs and Swift"
}'

Response (200)

{
  "apiLimit": 91,
  "applicationCount": 1,
  "applicationLimit": 73,
  "billingEmail": "lulu_kuhn@wiegand.biz",
  "campaignLimit": 29,
  "campaignsActiveCount": 75,
  "campaignsInactiveCount": 7,
  "companyName": "Labadie, Jacobs and Swift",
  "created": "2016-02-01T08:38:30Z",
  "domainName": "KossGroup.talon.one",
  "id": 69,
  "modified": "2016-05-25T05:24:28Z",
  "planExpires": "2016-10-20T13:47:31Z",
  "planName": "booked plan name",
  "state": "trial_expired",
  "userCount": 4,
  "userLimit": 1
}