Store

The store service allows you to store or retrieve small pieces of information.

Subscriber

You can add a subscription like (method: PUT) store://<varname>?value={{event_var}} to insert a piece of information into the store.

If you want to retrieve a store as part of an event, use (method: GET) store://<varname>

You can also add a key query param while putting or posting, so that you will be able to retrieve or update the value outside of ubsub.io

Limitations

  • Name: 16 chars
  • Value: 32 chars
  • Key: 16 chars

REST Api

Host: https://store.ubsub.io

You must add an Authorization header or key query param with the key assigned to the variable set you wish to operate on. If no key is set, no operation will be permitted via the API.

This API does not work with the router API keys.

GET /var/:userId

Retrieve all readable values stored for a user with a shared key.

Example response:

[
  {
    "id": 34,
    "user_id": "test",
    "name": "test2",
    "key": null,
    "value": "hi2",
    "createdAt": "2018-07-28T20:08:26.718Z",
    "updatedAt": "2018-07-28T20:08:26.718Z"
  },
  ...
]

GET /var/:userId/:varId

Get a specific varId. Must have key set to be retrievable.

Return 404 if no such value exists.

Example response:

{
    "id": 34,
    "user_id": "test",
    "name": "test2",
    "key": null,
    "value": "hi2",
    "createdAt": "2018-07-28T20:08:26.718Z",
    "updatedAt": "2018-07-28T20:08:26.718Z"
}

POST /var/:userId/:varId?value=...

Create a new variable with the id. If the variable already exists, this call will fail. Use PUT to create or update.

Example response:

{
    "id": 34,
    "user_id": "test",
    "name": "test2",
    "key": null,
    "value": "hi2",
    "createdAt": "2018-07-28T20:08:26.718Z",
    "updatedAt": "2018-07-28T20:08:26.718Z"
}

PUT /var/:userId/:varId?value=...

Create or update value on a variable.

{
    "id": 34,
    "user_id": "test",
    "name": "test2",
    "key": null,
    "value": "hi2",
    "createdAt": "2018-07-28T20:08:26.718Z",
    "updatedAt": "2018-07-28T20:08:26.718Z"
}

DELETE /var/:userId/:varId

Remove variable from store.

200 if OK.