πͺ NOMIE API
Nomie API Plugin
The Nomie API plugin allows you to push data notes into Nomie, for example importing your sleep data using IFTTT or Zapier. The πͺNomie API Plugin acts as a client between a Nomie API Server and the Nomie app. The Nomie API Server should be installed seperately. Instructions can be found in the API Server Documentation. API calls are not sent directly to the device. Instead, each note sent through the API is encrypted with your public key and held in a slot on the API Server until Nomie on your device can import and decrypt it. That slot will be freed up once Nomie pulls the note down.
What’s the API?
An API (“application programming interface”) is how two programs can talk to each other remotely. Nomie’s API lets you send data from external apps / websites / services into Nomie. Nomie’s API DOES NOT send data OUT of the app, only for bringing data in (for security purposes).
Installing the Plugin
The url of the plugin is: https://dailynomie.github.io/nomie-plugin-api/
The πͺNomie API Plugin can be installed in Nomie via the following steps:
- Go to the More Tab
- Select Plugins
- Click the + or Add Custom Plugin
- Provide the url for the plugin
- Tap Install Plugin
Configuring the Plugin
After installing the plugin, please open the plugin and you will be prompted to generate a new API key on an API server. Alternatively -if you already have an API key from a previous configuration- you can restore that key.
Generating a new key
Click on the New Key button and you will be prompted to provide the domain of your api server. You only have to provide the domain of your server (so without the https://). preferably you will host your own server, for convenience I have enabled a server which I only support on best effort: api.dailynomie.com
After your key is generated, you are ready to receive notes/logs.
Restore a key
If you previously acquired a key and you want to restore that on your device, you can do that by clicking on the Restore Key button.
in order to do so you need to provide the following information:
- the domain of the server your previous key was acquired from
- your previous API key
- your previous private key
Only the combination of above information will enable a restore, so please make sure to keep these details after you have been provided with an api key.
Sending Data to the API
Preferably you wil host your own Nomie API Server (and as such have your own url), but for convenience I have made a server available which I will support on best effort only.
- URL :https://api.dailynomie.com/log
- METHOD : POST
- BODY : application/json
Available payload properties:
note – the content of the note to save in Nomie. Can include #tracker, @people, +context, text, anything
api_key – your api key
lat – latitude of a location
lng – longitude of a location
date – Date of event – any[javascript date format
Minimum required body payload
{ "note": "Content of Note to save to nomie", "api_key": "YOUR API KEY" }
All Available Options
{ "lat": 31.3456, "lng" : -81.43235, "date": "2020-09-14T12:00:00.130Z", "note" : "#tracker(123) @person +context", "api_key": "YOUR API KEY" }
Curl Example
curl --request POST \ --url https://nomieapi.com/log \ --header 'Content-Type: application/json' \ --data '{ "lat": 31.3456, "lng" : -81.43235, "date": "2020-09-14T12:00:00.130Z", "note" : "NOTE CONTENT HERE", "api_key": "YOUR API KEY" }'
The Plugin Settings
After succesfully registering an api key you will be able to further configure some settings. When setting up the plugin for the first time, you will be directed to the settings page automatically. Otherwise you can access the settings page by clicking on the settings icon in the menu:
You will be directed to the following screen:
- Your API Key (you need this key to send logs/notes to Nomie)
- An example request. This will show you an example request which you can send to the API.
- Advanced. By expanding the advanced section you can copy your private key. You need your private key to restore your API (for example on an other device)
- Auto save new logs. Everytime data is send to the api, your data is stored (in an encrypted slot) on the server. When you open the Nomie app on your device, Nomie will pull the data from the server and empty the related server slots. When autosave is enabled, Nomie will automatically save the pulled data into Nomie log/note entries. When autosave is disabled, Nomie will hold the data untill you will manually authorise each pulled slot to flow into Nomie as a log/note.
- Toggle to switch the API functionality on and off. When disables, Nomie will NOT reach out to the server to pull data slots.
- You can either remove the current key from the Nomie app, but it will be kept on the server so you can resore it later. You can also fully destroy your key on both the client and the server. You API key will be gone…forever π
New Entries and Archive
When configured and enabled, the default startpage for the plugin is the inbox/archive section. This section can also be reached from other sections by clicking in the left top corner of the plugin:
The New Entries and Archive sections looks as follows:
New Entries
In above example I have just send over 2 entries via the api. Autosave is set to off, so you can manually decide what to do with the entry. You can either delete the entry by clicking on the bin icon, or you can save the entry.
Archive
From above example i have deleted one item and saved the other item. Both items will be stored in the archive….so you can repair any mistakes you madeπ:
For the deleted/discarded entries, you have the option to restore them. When completely confident, you can clear the full archive.