You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,17 +75,11 @@ Whether you want to test the client installation or simply check more examples o
71
75
72
76
### Constructors
73
77
74
-
`SlicingDice(const char* apiKey)`
75
-
*`apiKey (const char*)` - [API key](http://panel.slicingdice.com/docs/#api-details-api-connection-api-keys) to authenticate requests with the SlicingDice API.
`SlicingDice(const char* apiKey, boolean production, const char* host, int port)`
78
79
*`apiKey (const char*)` - [API key](http://panel.slicingdice.com/docs/#api-details-api-connection-api-keys) to authenticate requests with the SlicingDice API.
79
-
*`host (const char*)` - [Connection endpoint](http://panel.slicingdice.com/docs/#api-details-api-connection-connection-endpoints) to use when generating requests to SlicingDice.
80
-
81
-
`SlicingDice(const char* apiKey, const char* host, int port)`
82
-
*`apiKey (const char*)` - [API key](http://panel.slicingdice.com/docs/#api-details-api-connection-api-keys) to authenticate requests with the SlicingDice API.
83
-
*`host (const char*)` - [Connection endpoint](http://panel.slicingdice.com/docs/#api-details-api-connection-connection-endpoints) to use when generating requests to SlicingDice.
84
-
*`port (int)` - Port to connect to when generating requests. Particularly useful when connect to `http://localhost`.
80
+
*`production(boolean)` - (Default: true) If true the client will send requests to production end-point, otherwise to tests end-point.
81
+
*`host (const char*)` - (Default: api.slicingdice.com) [Connection endpoint](http://panel.slicingdice.com/docs/#api-details-api-connection-connection-endpoints) to use when generating requests to SlicingDice.
82
+
*`port (int)` - (Default: 80) Port to connect to when generating requests. Particularly useful when connect to `http://localhost`.
85
83
86
84
### `void index(JsonObject& query)`
87
85
Index data to existing entities or create new entities, if necessary. This method corresponds to a [POST request at /index](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-index).
@@ -92,93 +90,40 @@ Index data to existing entities or create new entities, if necessary. This metho
92
90
#include<SlicingDice.h>
93
91
#include<ArduinoJson.h>
94
92
95
-
#defineBUFFER_SIZE 256
96
-
97
-
SlicingDice sd = SlicingDice("API_KEY");
93
+
// If you need a demo API key visit: https://panel.slicingdice.com/docs/#api-details-api-connection-api-keys-demo-key
94
+
String apiKey = String("YOUR_API_KEY");
95
+
// if false will use test end-point, otherwise production end-point
Index data to existing entities or create new entities, if necessary. This method corresponds to a [POST request at /index](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-index).
145
-
146
-
#### Request example
147
-
148
-
```c
149
-
#include<SlicingDice.h>
150
-
#include<ArduinoJson.h>
151
-
152
-
#defineBUFFER_SIZE 256
153
-
154
-
SlicingDice sd = SlicingDice("API_KEY");
155
-
156
-
voidsetup() {
157
-
// Open serial communication and wait for port to open
0 commit comments