# "Keywords" Key:Value Store DIX provides a key:value store where participants can update portions of a shared JSON object. Users are allocated different "keywords" which are the top level properties within the shared Keywords object. Users' API keys are granted access to write their own keywords but cannot mutate anyone else's keywords. Users are able to store whatever properties or objects they'd like within their Keyword and therefore the object has no specific structure. Routes exists to fetch paths within the Keywords object and should be used over fetching the entire Keywords object. ## Routes ### Get All Keywords Route: /keywords Verb: GET Fetch the entire Keywords object ### Get Keywords Path Route: /keywords/:path Verb: POST Fetch a portion of the Keywords object at the specified path, path should be supplied in point notation. For example, given the following Keywords object: ```json { "userA": { "status": "Working on a fun project", "twitter": "useruseruser" }, "userB": { "favouriteNouns": [10, 55, 182] } } ``` A request to `/keywords/userB.favouriteNouns` would return: ```json [10, 55, 182] ``` ### Update Keywords Path Route: /keywords/:path Verb: POST If you have an API key, you can update any property within the Keywords object by making a call to the Keywords API with your API key as a Bearer token. Your path must begin with your allocated keyword. Any path will be created upon insertion. Data should be of type `string` or a JSON object with the appropriate content-type. cURL example setting a property to a string: ``` curl --request POST \ --url http://dix.sh/keywords/userA.status \ --header 'Authorization: Bearer thisIsUserAsAPIKey' \ --header 'Content-Type: text/plain' \ --data 'I'\''m working on a very fun project' ``` cURL example setting a property to a JSON object: ``` curl --request POST \ --url http://dix.sh/keywords/userA.miscData.my_property \ --header 'Authorization: Bearer thisIsUserAsAPIKey' \ --header 'Content-Type: application/json' \ --data '{ "number": 99, "message": "hi" }' ``` ### Delete Keywords Path Route: /keywords/:path Verb: DELETE You may delete any portion of the Keywords object that's underneath your allocated keyword using your API key. ``` curl --request DELETE \ --url http://dix.sh/keywords/userA.miscData \ --header 'Authorization: Bearer thisIsUserAsAPIKey' ```