Add indexer readme

This commit is contained in:
IamTheFij 2018-02-03 00:34:14 -08:00
parent b5358b2878
commit d455ed1700

48
indexer/Readme.md Normal file
View File

@ -0,0 +1,48 @@
# Indexer
Simple service to act as data layer for Email Assitant
# Healthcheck
Path: `/`
Returns: `OK`
# Tokens
Path: `/token`
## POST
Accepts JSON representation of a EmailToken
Accepts:
|Field|Type|Example|
|---|---|---|
|`"subject"`|String|`"Your shipping info"`|
|`"token"`|String|`"123456"`|
|`"type"`|String|`"SHIPPING"`|
|`"metadata"`|Object (optional)|`{"carrier": "UPS"}`|
|`"disabled"`|Boolean (optional)|`false`|
Returns:
|Field|Type|Example|
|---|---|---|
|`"success"`|Boolean|`true`|
|`"token"`|Token Object|`{"id": 1, ... }`|
## GET
Path: `/token`
Returns all Token Objects
Parameters:
|Parameter|Description|Example|
|---|---|---|
|`"filter_type"`|String token type to filter by|`SHIPPING`|
Returns:
|Field|Type|Example|
|---|---|---|
|`"tokens"`|List of Token Objects|`[{"id": 1, ... }, ...]`|
Path: `/token/<int:token_id>`
Returns Token Object with that ID