|
1 |
| -#Logging Api |
2 |
| -**PRE-RELEASE** |
3 |
| -> *NOTE*: This is a prerelease api and is subject to change frequently without notice or versioning while under development. |
| 1 | +# Initial State Events Api |
4 | 2 |
|
| 3 | +Documentation is in api blueprint flavored markdown. |
5 | 4 |
|
6 |
| -There are 2 POST calls that are necessary to call in order to send data via API. There execution is independent of each other, so you can call in any order, the most important shared pieces of data are the `bucketName` and the `sessionId`. |
7 |
| - |
8 |
| -Authentication is handled via `clientKey`, don't loose, publish or share. If you do, please delete the key from your account. |
9 |
| - |
10 |
| - |
11 |
| -##[POST] |
12 |
| - |
13 |
| -`https://api.initialstate.com/api/v1/buckets` |
14 |
| - |
15 |
| -###Headers: |
16 |
| -``` |
17 |
| -Content-Type: application/json |
18 |
| -``` |
19 |
| - |
20 |
| -###Expected Body: |
21 |
| - |
22 |
| -####Example Body |
23 |
| - |
24 |
| -``` |
25 |
| -{ |
26 |
| - "bucketId": "dc5c3b77-2c9a-4efd-a4ee-68759114e356", |
27 |
| - "bucketName": "The Bucket", |
28 |
| - "clientKey": "YourClientKey" |
29 |
| -} |
30 |
| -``` |
31 |
| - |
32 |
| -####Request Body |
33 |
| -JSON request body |
34 |
| - |
35 |
| -|name|type|notes| |
36 |
| -|----|----|-----| |
37 |
| -|bucketId|`guid`|this is a unique identifier, it should be the same value as what you use when sending logs in `tid`| |
38 |
| -|bucketName|`string`|name of the bucket, 200 character limitation| |
39 |
| -|clientKey|`string`|secret key you get from the initialstate.com| |
40 |
| - |
41 |
| - |
42 |
| -###Response Codes: |
43 |
| -- `201` Created |
44 |
| -- `401` Unauthorized (`clientKey` is either incorrect, or url isn't correct) |
45 |
| -- `403` Forbidden (`clientKey` is missing or invalid) |
46 |
| -- `404` Check your url |
47 |
| -- `500` Internal Server Error (we're still in beta :) ) |
48 |
| - |
49 |
| - |
50 |
| -##[POST] |
51 |
| - |
52 |
| -`https://groker.initialstate.com/batch_logs` |
53 |
| - |
54 |
| -###Headers: |
55 |
| -``` |
56 |
| -Content-Type: application/json |
57 |
| -X-IS-ClientKey: YourClientKey |
58 |
| -``` |
59 |
| - |
60 |
| -###Expected Body: |
61 |
| - |
62 |
| - |
63 |
| -####Example: |
64 |
| - |
65 |
| -``` |
66 |
| -[ |
67 |
| - { |
68 |
| - "b": "some_bucket_name", |
69 |
| - "sn": "example_signal", |
70 |
| - "v": 1, |
71 |
| - "e": 1416262288.913554, |
72 |
| - "tid": "dc5c3b77-2c9a-4efd-a4ee-68759114e356" |
73 |
| - } |
74 |
| -] |
75 |
| -``` |
76 |
| - |
77 |
| -####Request Body |
78 |
| -The request body is an array of JSON objects with the following properties |
79 |
| - |
80 |
| -|name|type|notes | |
81 |
| -|----|----|--------| |
82 |
| -|`v` |`string`, `bool` or `number`|value of data point | |
83 |
| -|`b` |`string`|bucket name; length 200| |
84 |
| -|`e` |`float`|epoc representation of timestamp| |
85 |
| -|`sn` |`string`|signal name, recommended shorter than 50 characters, hard cap at 100| |
86 |
| -|`tid` |`guid`|sessionId to associate to Initial State Bucket| |
87 |
| - |
88 |
| -###Response Codes: |
89 |
| -- `204` Empty Response |
90 |
| -- `403` Forbidden (`clientKey` is either missing or invalid) |
| 5 | +Read it here: http://docs.initialstateeventsapi.apiary.io/ |
0 commit comments