Skip to content

Commit e3e4c34

Browse files
committed
docs: added new routes and new ways to interface with streamer
1 parent 7f6fa6b commit e3e4c34

File tree

1 file changed

+82
-9
lines changed

1 file changed

+82
-9
lines changed

apiary.apib

+82-9
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,34 @@ A `version` is a string `semver`.
1717
+ Body
1818

1919
[
20-
"0.0.1"
20+
"0.0.1",
21+
"0.0.2",
22+
"0.0.3",
23+
"0.0.4"
2124
]
2225

2326

2427

2528
# Group Event Buckets
2629
**Buckets** are groupings of `event` data. They associate events together by a unique `bucketKey`. The `bucketKey`s uniqueness is scoped to an access key, so two buckets with the same bucketKey on two different access keys will result in two unique buckets.
2730

28-
## Buckets [/buckets]
31+
## Buckets JSON [/buckets]
2932
A `bucket` is a collection of `event` data.
3033

31-
Common Scenarios:
34+
Common Successful Response Scenarios:
3235
- `201`: If a `POST` is made to `/buckets` with a accessKey/bucketKey combination that is unique, doesn't exist, and can be created, the api will respond with a `201` Created response.
3336
- `204`: If a `POST` is made to `/buckets` with a accessKey/bucketKey combination that has already been created, the api will respond with a `204` No Content response.
3437

35-
**Custom Headers**
38+
**Authentication**
3639

37-
|name|notes|
40+
Authentication is handled via Access Keys generated from within your [Initial State account](https://www.initialstate.com/app#/account). An example access key looks like this: `fakee8do2JQN3Eos8Ah2FS8uiFD3Ola2`. An Access Key can be provided as an HTTP header, or as a url parameter
41+
42+
|type|name/key|
3843
|----|-----|
39-
|`X-IS-AccessKey`|This is the access key generated from www.initialstate.com account|
44+
|HTTP Header|`X-IS-AccessKey`|
45+
|URL Parameter|`accessKey`|
4046

41-
**Bucket JSON Entity**
47+
**Bucket Entity**
4248

4349
|parameter|required|type|illegal characters|length limit|notes|
4450
|---------|--------|----|-----|---|---|
@@ -71,16 +77,55 @@ Common Scenarios:
7177

7278
"ACCESS_DENIED_KEY"
7379

74-
+ Response 500
80+
+ Response 500 (text/plain)
7581

7682
+ Body
7783

7884
"CORE_API_ERROR"
7985

86+
## Buckets no-JSON [/buckets?accessKey={accessKey}&bucketKey={bucketKey}&bucketName={bucketName}]
87+
A `bucket` is a collection of `event` data.
88+
89+
Common Successful Response Scenarios:
90+
- `201`: If a `POST` is made to `/buckets` with a accessKey/bucketKey combination that is unique, doesn't exist, and can be created, the api will respond with a `201` Created response.
91+
- `204`: If a `POST` is made to `/buckets` with a accessKey/bucketKey combination that has already been created, the api will respond with a `204` No Content response.
92+
93+
**Authentication**
94+
95+
Authentication is handled via Access Keys generated from within your [Initial State account](https://www.initialstate.com/app#/account). An example access key looks like this: `fakee8do2JQN3Eos8Ah2FS8uiFD3Ola2`. An Access Key can be provided as an HTTP header, or as a url parameter
96+
97+
|type|name/key|
98+
|----|-----|
99+
|HTTP Header|`X-IS-AccessKey`|
100+
|URL Parameter|`accessKey`|
101+
102+
+ Parameters
103+
+ accessKey (required, string, `fakee8do2JQN3Eos8Ah2FS8uiFD3Ola2`) ... Access Key
104+
+ bucketKey (required, string, `bucket1sfa`) ... Unique Bucket Key
105+
+ bucketName (optional, string, `My New Bucket`) ... Friendly Bucket Name
106+
107+
### Create a bucket [POST]
108+
109+
+ Response 201 (application/json)
110+
+ Response 204
111+
+ Response 401
112+
+ Response 403 (text/plain)
113+
114+
+ Body
115+
116+
"ACCESS_DENIED_KEY"
117+
118+
+ Response 500 (text/plain)
119+
120+
+ Body
121+
122+
"CORE_API_ERROR"
123+
124+
80125
# Group Event Data
81126
These endpoints are related to the `events` resource. An `event` is simply a data point with a timestamp.
82127

83-
## Events [/events]
128+
## Events JSON [/events]
84129
### Send Events [POST]
85130
This is the main endpoint for shipping data to Initial State's Events Api. The data is sent in an array of JSON objects that represent individual events. You can submit one event or an array of events where the body size is not larger than 1 megabyte.
86131

@@ -184,5 +229,33 @@ This is the main endpoint for shipping data to Initial State's Events Api. The d
184229
{
185230
"message": "Event limit exceeded for current cycle..."
186231
}
232+
+ Response 409
233+
+ Response 429
234+
+ Response 500
235+
236+
## Events no-JSON [/events?accessKey={accessKey}&bucketKey={bucketKey}&{eventKey0}={eventValue0}&{eventKey1}={eventValue1}]
237+
238+
This route allows for simple URL encoded parameters that represent events. Each url key-value pair represents an event key and event value being sent to Initial State.
239+
240+
+ Parameters
241+
+ accessKey (required, string, `fakee8do2JQN3Eos8Ah2FS8uiFD3Ola2`) ... Access Key
242+
+ bucketKey (required, string, `bucket1sfa`) ... Bucket Key representing bucket for the events in request
243+
+ eventKey0 (optional, string, `eventKey0`) ... An events stream key
244+
+ eventValue0 (optional, string, `eventValue0`) ... `eventKey0`'s value
245+
+ eventKey1 (optional, string, `eventKey1`) ... An events stream key
246+
+ eventValue1 (optional, string, `eventValue1`) ... `eventKey1`'s value
247+
248+
### Send Events [GET]
249+
This is a break in the HTTP/1.1 spec to simplify sending events from devices without JSON serializors or full HTTP libraries with verb support. This route behaves similarly to the JSON route, but doesn't currently allow for overriding timestamps.
250+
251+
+ Response 204
252+
+ Response 401
253+
+ Response 402 (application/json)
254+
+ Body
255+
256+
{
257+
"message": "Event limit exceeded for current cycle..."
258+
}
259+
+ Response 409
187260
+ Response 429
188261
+ Response 500

0 commit comments

Comments
 (0)