Rewards

All rewards endpoints have path prefix /rewards-service.

Module

Activate Rewards Module

Activate rewards module for the participant. Takes JSON object containing module name rewards. Responds with list of participant's enabled modules. Current participant must be either System (can activate rewards for Partner, Manufacturer, Product 360, Expert or Retailer participants) or Partner with active rewards module (can active rewards for child Manufacturer, Product 360, Expert or Retailer participants).

POST /rewards-service/participants/:id/modules
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Participant identifier
module string e.g. "rewards"
Example Response
[
    "rewards",
    "other_module",
    "yet_another_module"
]

Deactivate Rewards Module

Deactivate rewards module for the participant. Required current participant permissions are the same as for activate module endpoint.

DELETE /rewards-service/participants/:id/modules/:module
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Participant identifier
module string e.g. "rewards"

Campaigns

Example of system campaign

{
  "_id": "urn:authenticateit:campaign:1",
  "events": [
    {
      "scan": {
        "coins": 5000000
      }
    }
  ],
  "name": "System campaign",
  "owner": "urn:authenticateit:participant:1",
  "type": "rewards_campaign"
}

Create Rewards Campaign

Create rewards campaign. Takes JSON object containing campaign name, start date, end date (optional, campaign is continuous if there is no end date), campaign budget, products filter (all participant products are eligible for campaign, if the filter is missing), audience filter and list of user action events. Responds with created rewards campaign representation.

Campaign must have overall budget (field budget.overall is required).

Currenct participant must be Product 360, Manufacturer, Retailer, Expert, System or Partner and must have rewards module activated.

POST /rewards-service/rewards_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "name": "Some Campaign",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2016-12-24T00:00:00Z",
  "budget": {
    "day": 1000,
    "week": 7000,
    "month": 15000,
    "overall": 150000
  },
  "products": [
    "09780996791304"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "female",
    "languages": [
      "en"
    ],
    "locations": [
      "12345",
      "67890"
    ],
    "user_levels": [
      "gold"
    ]
  },
  "status": "active",
  "events": [
    {
      "view_text": {
        "coins": 1512313,
        "condition": "monthly"
      }
    },
    {
      "follow_fb": {
        "coins": 3500000,
        "condition": "once"
      }
    }
  ]
}

Example Response

{
  "id": "urn:authenticateit:campaign:12345678901245",
  "owner": "urn:epc:sgln:0614141.12345.1",
  "name": "Some Campaign",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2016-12-24T00:00:00Z",
  "budget": {
    "day": 1000,
    "week": 7000,
    "month": 15000,
    "overall": 150000
  },
  "products": [
    "09780996791304"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "female",
    "languages": [
      "en"
    ],
    "locations": [
      "12345",
      "67890"
    ],
    "user_levels": [
      "gold"
    ]
  },
  "status": "active",
  "events": [
    {
      "view_text": {
        "coins": 150000,
        "condition": "monthly"
      }
    },
    {
      "follow_fb": {
        "coins": 350000,
        "condition": "once"
      }
    }
  ]
}

Update Rewards Campaign

Endpoint for owner participant to update it's rewards campaign. Takes JSON object containing rewards campaign (see endpoint for rewards campaign creation). Responds with updated rewards campaign representation.

Currenct participant must have rewards module activated and must be campaign owner.

PUT /rewards-service/rewards_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "name": "Renamed Campaign",
  "end_date": "2016-12-31T00:00:00Z",
  "budget": {
    "overall": 350000
  },
  "status": "inactive"
}

Example Response

{
  "id": "urn:authenticateit:campaign:12345678901245",
  "owner": "urn:epc:sgln:0614141.12345.1",
  "name": "Renamed Campaign",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2016-12-31T00:00:00Z",
  "budget": {
    "overall": 350000
  },
  "products": [
    "09780996791304"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "female",
    "languages": [
      "en"
    ]
  },
  "status": "inactive",
  "events": [
    {
      "view_text": {
        "coins": 1500000,
        "condition": "monthly"
      }
    },
    {
      "follow_fb": {
        "coins": 3500000,
        "condition": "once"
      }
    }
  ]
}

Delete Rewards campaign

Endpoint for participant to delete it's rewards campaign. Participant must have rewards module activated and must be campaign. owner.

DELETE /rewards-service/rewards_campaigns/{id}
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier

List Reward Campaigns

List participant's own reward campaigns. Responds with a list of reward campaign representations. The resulting list may be filtered by sending parameters in the request JSON body. All parameters are optional.

Campaigns can be filtered by audience (audience parameter (empty filter by default), see example request below), number of campaigns can be skipped from output (offset parameter (0 if unspecified)), and resulting list length can be limited (limit parameter (100 if unspecified)).

Campaigns can be filtered by events (events parameter (empty filter by default), see example request below), by start and end dates range (start_date and end_date fields).

POST /rewards-service/rewards_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "audience": {
    "min_age": 21,
    "max_age": 25,
    "city": "Nagpur",
    "country": "356",
    "gender": "male",
    "language": "en",
    "state": "Maharashtra",
    "user_level": "bronze"
  },
  "events": {
    "type": "view_popup",
    "condition": "daily"
  },
  "start_date": "2016-05-05",
  "end_date": "2017-12-31",
  "offset": 5,
  "limit": 1
}
Example Response
[
  {
    "audience": {
      "countries": [
        "643", "356"
      ],
      "city": "Nagpur",
      "state": "Maharashtra",
      "gender": "male",
      "languages": [
        "ru",
        "en"
      ],
      "max_age": 24,
      "min_age": 22,
      "user_levels": [
        "platinum",
        "bronze"
      ]
    },
    "budget": {},
    "events": [
      {
        "view_popup": {
          "coins": 100000000,
          "condition": "daily",
          "unique_location": false
        }
      }
    ],
    "id": "urn:authenticateit:campaign:795220009246909",
    "name": "Test conditions campaign",
    "owner": "urn:authenticateit:participant:841535075581481",
    "products": [
      "00000026037431"
    ],
    "start_date": "2017-08-20",
    "status": "active"
  }
]

Claim Reward Campaign Coins

API endpoint for user to claim reward campaign coins. Takes JSON object containing identifier of the corresponding scan and list of user action events. Responds with the number of pending coins. Created claim will be processed by the system in due time and either approved (user will be notified and pending coins will be transferred to the user account) or rejected.

POST /rewards-service/rewards_campaigns/:id/coin_claims
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "events": ["view_text", "follow_fb"],
  "scan_id": "763c0cf3-9949-4c2d-a0c8-700159f68b09"
}
Example Response
{
  "pending_coins": 50
}

Rewards Budget

Set Participant Budget

Endpoint for participant to set own rewards campaigns budget. Takes JSON object containing budget. Participant must have active rewards module.

PUT /rewards-service/rewards_campaigns/budget
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "budget": {
    "day": 10,
    "week": 70,
    "month": 300
  }
}

Set Participant Budget Limit

Endpoint for System or Partner to limit participant's rewards campaigns budget. Takes JSON object containing budget. Participant must have active rewards module. If current participant is Partner, it also must have active rewards module, participant must be child of Partner.

PUT /rewards-service/participants/:id/rewards_campaigns/budget_limit
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "budget": {
    "day": 20,
    "week": 140,
    "month": 600
  }
}

Rewards points

The system logged all income from the accrual points call internal methods

Set Participant points packet

POST /rewards-service/billing/packet
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
points number Points

Get available points

GET /rewards-service/billing/points
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Shoutouts

Create shoutout

POST /rewards-service/shoutouts_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name string Required: Shoutout name
copy string Required: Push message
products list Required: List of products
start_date string Start datetime
end_date string End datetime
delay integer Delay in minutes when message will be send
count integer Coun of mathing the campaign when message wil be send
audience object Audience object
status string "active" (default) or "inactive"
Audience object
Name Type Description
countries list List of countries
languages list List of languages
min_age integer Min user age
max_age integer Max user age
gender string User's gender
locations list List of locations
user_levels list User's levels list
advanced object Advanced object
Advanced object

May contain inverse flag - "inverse": true or false

Example Request
{
  "name": "Test 1",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2017-12-24T00:00:00Z",
  "products": [
    "00000026033419"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "locations": [
      "urn:authenticateit:location:1487249964787"
    ],
    "user_levels": [
      "gold",
      "bronze",
      "basic"
    ],
    "advanced": {
      "brand_scans": {
        "scans_from": 1,
        "scans_to": 3,
        "date_from": "2016-12-15T00:00:00Z",
        "date_to": "2017-12-15T00:00:00Z"
      },
      "weekly_scans": {
        "from": 1,
        "to": 3
      },
      "last_scan_date": {
        "date": "2017-12-15T00:00:00Z"
      },
      "countries": {
        "list": [
          "036",
          "643"
        ],
        "inverse": true
      }
    }
  },
  "copy": "Some push message",
  "delay": 4,
  "status": "active",
  "count": 1
}
Example Response
{
"audience": {
"advanced": {
"brand_scans": {
"date_from": "2016-12-15T00:00:00Z",
"date_to": "2017-12-15T00:00:00Z",
"scans_from": 1,
"scans_to": 3
},
"countries": {
"inverse": true,
"list": [
  "036",
  "643"
],
},
"last_scan_date": {
"date": "2017-12-15T00:00:00Z"
},
"weekly_scans": {
"from": 1,
"to": 3
}
},
"countries": [
  "036"
],
"gender": "other",
"languages": [
  "en"
],
"locations": [
  "urn:authenticateit:location:1487249964787"
],
"max_age": 35,
"min_age": 20,
"user_levels": [
  "gold",
  "bronze",
  "basic"
],
},
"copy": "Some push message",
"count": 1,
"delay": 4,
"end_date": "2017-12-24T00:00:00Z",
"id": "urn:authenticateit:shoutout:013506706920330",
"name": "Test 1",
"owner": "urn:authenticateit:participant:841535075581481",
"products": [
  "00000026033419"
],
"start_date": "2016-12-15T00:00:00Z",
"status": "active"
}

Read shoutout

GET /rewards-service/shoutouts_campaigns/{id}/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Response
{
"audience": {
"advanced": {
"brand_scans": {
"date_from": "2016-12-15T00:00:00Z",
"date_to": "2017-12-15T00:00:00Z",
"scans_from": 1,
"scans_to": 3
},
"countries": {
"inverse": true,
"list": [
  "036",
  "643"
],
},
"last_scan_date": {
"date": "2017-12-15T00:00:00Z"
},
"weekly_scans": {
"from": 1,
"to": 3
}
},
"countries": [
  "036"
],
"gender": "other",
"languages": [
  "en"
],
"locations": [
  "urn:authenticateit:location:1487249964787"
],
"max_age": 35,
"min_age": 20,
"user_levels": [
  "gold",
  "bronze",
  "basic"
],
},
"copy": "Some push message",
"count": 1,
"delay": 4,
"end_date": "2017-12-24T00:00:00Z",
"id": "urn:authenticateit:shoutout:013506706920330",
"name": "Test 1",
"owner": "urn:authenticateit:participant:841535075581481",
"products": [
  "00000026033419"
],
"start_date": "2016-12-15T00:00:00Z",
"status": "active"
}

Update shoutout

PUT /rewards-service/shoutouts_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "name": "Test 1",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2017-12-24T00:00:00Z",
  "products": [
    "00000026033419"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "locations": [
      "urn:authenticateit:location:1487249964787"
    ],
    "user_levels": [
      "gold",
      "bronze",
      "basic"
    ],
    "advanced": {
      "brand_scans": {
        "scans_from": 1,
        "scans_to": 3,
        "date_from": "2016-12-15T00:00:00Z",
        "date_to": "2017-12-15T00:00:00Z"
      },
      "weekly_scans": {
        "from": 1,
        "to": 3
      },
      "last_scan_date": {
        "date": "2017-12-15T00:00:00Z"
      },
      "countries": {
        "list": [
          "036",
          "643"
        ],
        "inverse": true
      }
    }
  },
  "copy": "Some push message",
  "delay": 4,
  "status": "inactive",
  "count": 1
}
Example Response
{
"audience": {
"advanced": {
"brand_scans": {
"date_from": "2016-12-15T00:00:00Z",
"date_to": "2017-12-15T00:00:00Z",
"scans_from": 1,
"scans_to": 3
},
"countries": {
"inverse": true,
"list": [
  "036",
  "643"
],
},
"last_scan_date": {
"date": "2017-12-15T00:00:00Z"
},
"weekly_scans": {
"from": 1,
"to": 3
}
},
"countries": [
  "036"
],
"gender": "other",
"languages": [
  "en"
],
"locations": [
  "urn:authenticateit:location:1487249964787"
],
"max_age": 35,
"min_age": 20,
"user_levels": [
  "gold",
  "bronze",
  "basic"
],
},
"copy": "Some push message",
"count": 1,
"delay": 4,
"end_date": "2017-12-24T00:00:00Z",
"id": "urn:authenticateit:shoutout:013506706920330",
"name": "Test 1",
"owner": "urn:authenticateit:participant:841535075581481",
"products": [
  "00000026033419"
],
"start_date": "2016-12-15T00:00:00Z",
"status": "inactive"
}

Delete shoutout

DELETE /rewards-service/shoutouts_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier

Read shoutouts

GET /rewards-service/shoutouts_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number Skip specified number of campaigns.
limit number Limit the number of returned campaigns.

Read and filter shoutouts

All parameters are optional.

POST /rewards-service/shoutouts_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
start_date string Date "2016-12-15"
end_date string Date "2017-12-15"
status string Shoutout status "active" or "inactive"
offset number Skip specified number of campaigns.
limit number Limit the number of returned campaigns.
audience object Audience filter
Audience filter
Name Type Description
country string or list "036" or ["036"], ["036", "643"]
language string or list "en" or ["en"], ["en", "ru"]
status string Shoutout status "active" or "inactive"
min_age integer Min age filter
max_age integer Max age filter
gender string "male" or "feamale" or "other"
user_level string or list "gold" or ["gold"], ["basic", "gold"]
locations string or list one or more location's id
Example Request
{
  "end_date": "2017-12-24",
  "start_date": "2016-12-15",
  "limit": 10,
  "ofset": 0,
  "audience": {
    "country": [
      "036"
    ],
    "user_level": [
      "basic"
    ],
    "language": [
      "en"
    ],
    "gender":"other"
  }
}
Example Response
[
  {
    "audience": {
      "advanced": {
        "brand_scans": {
          "date_from": "2016-12-15T00:00:00Z",
          "date_to": "2017-12-15T00:00:00Z",
          "scans_from": 1,
          "scans_to": 3
        },
        "countries": {
          "inverse": true,
          "list": [
            "036",
            "643"
          ]
        },
        "last_scan_date": {
          "date": "2017-12-15T00:00:00Z"
        },
        "weekly_scans": {
          "from": 1,
          "to": 3
        }
      },
      "countries": [
        "036"
      ],
      "gender": "other",
      "languages": [
        "en"
      ],
      "locations": [
        "urn:authenticateit:location:1487249964787"
      ],
      "max_age": 35,
      "min_age": 20,
      "user_levels": [
        "gold",
        "bronze",
        "basic"
      ]
    },
    "copy": "Some push message",
    "count": 1,
    "delay": 4,
    "end_date": "2017-12-24T00:00:00Z",
    "id": "urn:authenticateit:shoutout:013506706920330",
    "name": "Test 1",
    "owner": "urn:authenticateit:participant:841535075581481",
    "products": [
      "00000026033419"
    ],
    "start_date": "2016-12-15T00:00:00Z",
    "status": "inactive"
  }
]

Redemptions

List Available Rewards

List groups of rewards available for redemption. Query string parameter device_type (should be either android or ios) is used to filter out inappropriate (according to mobile device vendor) rewards. E.g., it may be used to filter out Google Play gift cards from the output on iOS devices. Response will contain a list of rewards. Each list item is either a product reward or a gift card reward.

GET /rewards-service/redemptions/rewards
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
device_type string Device type e.g. android
Example Response
[
  {
    "brand": "Sorny",
    "gtin": "11111111111113",
    "name": "Super Xyzzy 5000",
    "points_price": 800,
    "price": 400,
    "currency": "USD",
    "type": "product_reward"
  },
  {
    "brand": "Cyclon",
    "gtin": "33333333333339",
    "name": "Coupon 300F",
    "points_price": 200,
    "price": 150,
    "currency": "USD",
    "type": "product_reward"
  },
  {
    "card_type": "google",
    "not_device_types": [
      "ios"
    ],
    "points_price": 220,
    "price": 200,
    "currency": "USD",
    "type": "gift_card_reward"
  }
]

Redeem Reward

API to request reward redemption.

Either a product reward (parameters gtin and points must be provided in the request body) or a gift card reward (parameters card_type, price, currency and points must be provided) could be requested.

When a product reward is requested, user may pay less points than the points price of the reward. Brand related to the product will be notified about the request, and should contact the user directly to provide further instructions on how to pay the remaining amount (if less points were initially paid) and how to receive the reward. Created product redemption will be recorded in user's redemption history.

When a gift card reward is requested, provided points value must be exactly the points price of the gift card. User must have verified phone number in his account. Gift card number will be sent in a SMS message to phone number from user account. Created gift card redemption will be recorded in user's redemption history.

POST /rewards-service/redemptions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "gtin": "11111111111113",
  "points": 200
}

or

{
  "card_type": "google",
  "price": 200,
  "currency": "USD",
  "points": 220
}
Example Response
{
  "gtin": "11111111111113",
  "points": 200
}

Read Redemption History

Read user's history of reward redemptions. Response will contain the list of history entries. Each entry contains redemption timestamp, redeemed reward type and number of spent points.

GET /rewards-service/redemptions/history
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
  {
    "points": 220,
    "reward": {
      "card_type": "google",
      "not_device_types": [
        "ios"
      ],
      "points_price": 220,
      "price": 200,
      "currency": "USD",
      "type": "gift_card_reward"
    },
    "ts": "2017-03-30T19:49:24Z"
  },
  {
    "points": 200,
    "reward": {
      "brand": "Sorny",
      "gtin": "11111111111113",
      "name": "Super Xyzzy 5000",
      "points_price": 800,
      "price": 400,
      "currency": "USD",
      "type": "product_reward"
    },
    "ts": "2017-03-30T19:26:01Z"
  }
]

Bots

Create Bot

Create rewards bot. Takes JSON object containing bot name, start time (optional), end time (optional, bot is always active if there is no end date), list of GTINs (bot will be activated for these products), audience filter and list of text and media (image or video) widgets. Responds with created bot representation.

Bot audience is a JSON object with fields countries, min_age, max_age, gender, languages, last_scan_date (users with the last scan activity earlier than the specified date), weekly_scans (a JSON object with optional fields from and to, having integer values, the minimum and maximum number of scans during the last seven days), scan_countries (list of countries where a product was scanned), registration_methods (list of allowed registration methods, where method is either facebook or email). All fields are optional.

Currenct participant must have rewards module activated.

POST /rewards-service/bots
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "name": "Sample Bot",
  "status": "active",
  "start_time": "2017-01-01T13:00:00Z",
  "end_time": "2017-03-05T18:30:00Z",
  "audience": {
    "countries": [
      "036",
      "643"
    ],
    "languages": [
      "en",
      "ru"
    ],
    "min_age": 25,
    "max_age": 30,
    "gender": "male",
    "registration_methods": [
      "email",
      "facebook"
    ],
    "last_scan_date": "2017-06-06",
    "weekly_scans": {
      "from": 15,
      "to": 30
    },
    "scan_countries": [
      "036",
      "643"
    ]
  },
  "products": [
    "09780996791304"
  ],
  "text_widgets": [
    {
      "text": {
        "title": "Nice Title!",
        "text": "The text includes some `markdown`.",
        "markdown": true
      }
    }
  ]
  "media_widgets": [
    {
      "image": [
        {
          "url": "http://example.org/img1.png"
        },
        {
          "url": "http://example.org/x.jpg"
        }
      ]
    },
    {
      "video": {
        "title": "Our Product",
        "url": "http://example.org/vid.mp4",
        "preview": "http://example.org/vid-small.jpg"
      }
    }
  ]
}
Example Response
{
  "audience": {
    "countries": [
      "036",
      "643"
    ],
    "gender": "male",
    "languages": [
      "en",
      "ru"
    ],
    "max_age": 30,
    "min_age": 25,
    "registration_methods": [
      "email",
      "facebook"
    ]
  },
  "end_time": "2017-03-05T18:30:00Z",
  "id": "urn:authenticateit:bot:808678240218235",
  "name": "Sample Bot",
  "owner": "urn:authenticateit:participant:1491563346054",
  "products": [
    "09780996791304"
  ],
  "start_time": "2017-01-01T13:00:00Z",
  "status": "active",
  "text_widgets": [
    {
      "text": {
        "markdown": true,
        "text": "The text includes some `markdown`.",
        "title": "Nice Title!"
      }
    }
  ]
  "media_widgets": [
    {
      "image": [
        {
          "url": "http://example.org/img1.png"
        },
        {
          "url": "http://example.org/x.jpg"
        }
      ]
    },
    {
      "video": {
        "preview": "http://example.org/vid-small.jpg",
        "title": "Our Product",
        "url": "http://example.org/vid.mp4"
      }
    }
  ]
}

Update Bot

Endpoint for owner participant to update it's rewards bot. Takes JSON object containing bot (see endpoint for bot creation). Responds with updated bot representation.

Currenct participant must have rewards module activated and must be bot owner.

PUT /rewards-service/bots/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id
status string Bot status e.g. "inactive"
Example Response
{
  "audience": {
    "countries": [
      "036",
      "643"
    ],
    "gender": "male",
    "languages": [
      "en",
      "ru"
    ],
    "max_age": 30,
    "min_age": 25,
    "registration_methods": [
      "email",
      "facebook"
    ]
  },
  "end_time": "2017-03-05T18:30:00Z",
  "id": "urn:authenticateit:bot:808678240218235",
  "name": "Sample Bot",
  "owner": "urn:authenticateit:participant:1491563346054",
  "products": [],
  "start_time": "2017-01-01T13:00:00Z",
  "status": "inactive",
  "text_widgets": [
    {
      "text": {
        "markdown": true,
        "text": "The text includes some `markdown`.",
        "title": "Nice Title!"
      }
    }
  ],
  "media_widgets": [
    {
      "image": [
        {
          "url": "http://example.org/img1.png"
        },
        {
          "url": "http://example.org/x.jpg"
        }
      ]
    },
    {
      "video": {
        "preview": "http://example.org/vid-small.jpg",
        "title": "Our Product",
        "url": "http://example.org/vid.mp4"
      }
    }
  ]
}

Delete Bot

DELETE /rewards-service/bots/{id}
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id

List Bots

List participant's own reward bots. Accepts offset (skip specified number of bots; 0 by default) and limit (limit the number of returned bots; 100 by default) query parameters. Responds with a list of bot representations.

GET /rewards-service/bots
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number skip specified number of bots
limit number Limit the number of returned bots
Example Response
[
  {
    "id": "urn:authenticateit:bot:427622626238419",
    "name": "Sample Bot 2",
    "owner": "urn:authenticateit:participant:1491563346054",
    "text_widgets": [
      {
        "text": {
          "text": "B"
        }
      }
    ]
  },
  {
    "id": "urn:authenticateit:bot:749469863100815",
    "name": "Sample Bot 1",
    "owner": "urn:authenticateit:participant:1491563346054",
    "text_widgets": [
      {
        "text": {
          "text": "A"
        }
      }
    ]
  }
]

Report Bot Widgets as Viewed

API for user to explicitly report bot video widgets as viewed. Widgets from bots received on a product scan will include bot_id field. If client receives a video widget with bot_id, it should report widget view with this API. Bot wouldn't suggest the next video from it's list until previous one is viewed.

Request must include media_widgets array of video widgets, which were viewed by the user. Each widget must have url and that URL must match URL in one of the bot's widgets. Response will be empty.

POST /rewards-service/bots/{id}/widgets/viewed
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id
Example Request
{
  "media_widgets": [
    {
      "video": {
        "url": "http://example.org/vid.mp4"
      }
    }
  ]
}

results matching ""

    No results matching ""