Welcome to the Consumer Engagement walkthrough. As you read through and try out the example API requests, you will be introduced to the basics of using the EVRYTHNG Platform in an example tagged products context. You will learn about:
- Projects and applications, which are used to manage access to resources.
- Products and Thngs, which are the core data storage resources in the Platform.
- Actions, which can be used to model data update events and notifications.
- Visualising the collected data with EVRYTHNG Dashboard widgets.
This API walkthrough will be themed around a simple consumer engagement scenario - using the EVRYTHNG Platform to implement and gain insights from a product packaging scanning campaign. This type of experience involves providing a dynamic experience to consumers who scan a QR code on the packaging of a product in order to obtain information, collect reward points, or some other incentive. You can read more about this type of use-case in Real-time Web Product Scanning.
All of the examples here use
curl, a standard Mac/Linux terminal program used to make web requests. You will be able to simply paste the examples into your Mac or Linux terminal and immediately see the results. In some cases you will need to replace a placeholder with a real value obtained from previous steps, these are called out as each case arises. In most cases, you will need to replace
$OPERATOR_API_KEY in each example with your own Operator API Key.
In order to use the EVRYTHNG Platform, you need to create a free account and obtain an Operator API Key. One of several types of API key, the Operator API Key allows request to be made on behalf of an account holder, and has the highest privileges.
To begin, create a Dashboard account (in either the US region or EU region) and log in. The EVRYTHNG Dashboard allows you to visually interact will all the resources in your account, and is useful for performing small-scale tasks. In addition to managing resources, you can also set up and use widget dashboards to gain insights into the data in your account. But for the purposes of this API walkthrough, we will only require finding the Operator API Key to begin with.
Choose the 'Account Settings' page using the top-right menu, which displays your Operator API Key. Make a note of this key before moving on to the next section.
You can follow along with this walkthrough in two recommended ways - using the EVRYTHNG CLI for simpler commands, or
cURL for a more detailed look at API interactions. Use the appropriate tab on each example to see the correct example for your chosen method.
The EVRYTHNG CLI makes API interactions easier by removing a lot of the moving parts. To get started, install using
npm and Node version 10 or above:
npm i -g evrythng-cli
Then, add your Operator API Key permanently as a new CLI operator.
us denotes the US Dashboard region (dashboard.evrythng.com) or use
eu instead for the EU Dashboard region (dashboard-eu.evrythng.com) and the full 80 character API key:
evrythng operators add ExampleAccount us 1FGqgM8xr13gx...
To make use of the code examples shown throughout this walkthrough as simple as possible, we recommend you export your Operator API Key at the start of your terminal session. This will save you needing to insert it into every request. For example, in your user profile (such as
.bash_profile or similar), or in the terminal itself:
Updated 2 months ago
|Projects and Applications|