diff --git a/.gitbook/assets/TRMNL-data-mode-example-node.png b/.gitbook/assets/TRMNL-data-mode-example-node.png new file mode 100644 index 0000000..fd99757 Binary files /dev/null and b/.gitbook/assets/TRMNL-data-mode-example-node.png differ diff --git a/SUMMARY.md b/SUMMARY.md index d723b46..1dffdae 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -38,9 +38,10 @@ ## Private API * [Introduction](private-api/introduction.md) -* [Fetch Screen Content](private-api/fetch-screen-content.md) -* [Fetch Plugin Content](private-api/fetch-plugin-content.md) +* [Screens API](private-api/fetch-screen-content.md) +* [Plugin Data API](private-api/fetch-plugin-content.md) * [Account API](private-api/account-api.md) +* [More Endpoints](private-api/more-endpoints.md) ## Partners API diff --git a/private-api/fetch-plugin-content.md b/private-api/fetch-plugin-content.md index 183c04b..b856d8f 100644 --- a/private-api/fetch-plugin-content.md +++ b/private-api/fetch-plugin-content.md @@ -2,7 +2,7 @@ description: Retrieve parsed plugin JSON data for your own templates. --- -# Fetch Plugin Content +# Plugin Data API No matter how many customizations we add to native plugins, there will always be a good reason to change them. Instead of cluttering our interface and adding complexity for other users, TRMNL offers a "data only" mode for native plugins. @@ -14,29 +14,25 @@ For more context on this feature, go [here](https://usetrmnl.com/blog/calendar-h First, set up + hide an instance of the plugin you want to re-build yourself. This instructs TRMNL to sync and parse data on your behalf. -1. Connect a native plugin, for example the Weather, Stock Prices, or any Calendar -2. Note the plugin's integer ID in the URL (`/plugin_settings/`) -3. Navigate to Playlists and "hide" the native plugin that was automatically added by clicking the eyeball icon. **This is important** because only plugins on a live playlist will be refreshed. By hiding this native plugin, your Data Mode plugin (below) will always have fresh data. +1. Connect a plugin, for example the Weather, Stock Prices, Calendar, etc +2. Navigate to Playlists and "hide" the plugin (click the eyeball icon) if you don't want to see it's native version on your device. **This is important** because only plugins on a Playlist will sync fresh data. Next, build a Private Plugin. -1. Navigate to Plugins > Private Plugin, select "Polling" as the Strategy -2. Input `https://usetrmnl.com/api/plugin_settings//data` as the Polling URL -3. Input `authorization=bearer ` as the Polling Header\* - -\*Find or generate a [User API Key](https://help.usetrmnl.com/en/articles/11195228-user-level-api-keys) on your Account tab - -Click save, then enter the Markup Editor. +1. Navigate to Plugins > Private Plugin, select "Plugin Merge" as the Strategy +2. Click Edit Markup

Private Plugin > Edit Markup

-Parsed data will appear inside a `data` node of the "Merge Variables" dropdown. You may need to click "Force Refresh" from the private plugin settings view to ensure data has been fetched. +Parsed data will appear inside a `_` node of the "Merge Variables" dropdown. You may need to click "Force Refresh" from the private plugin settings view to ensure data has been fetched. -

Example - Google Calendar "data mode"

+

Example - Outlook Calendar events JSON

+ +Reference as many connected plugins as you'd like. When TRMNL refreshes those plugins per your [Playlist Schedule](https://help.usetrmnl.com/en/articles/11663305-playlist-scheduler), updated values will map over to your private plugin with the Plugin Merge strategy. ### Markup Quickstart -If you only want to make small changes to the TRMNL native design, you can steal that markup here: +If you only want to make small changes to the TRMNL native design, steal that markup here: * [https://github.com/usetrmnl/plugins/](https://github.com/usetrmnl/plugins/) (raw inside `lib`, let us know what else you need) * [https://usetrmnl.com/plugins/demo](https://usetrmnl.com/plugins/demo) (rendered output, requires login) diff --git a/private-api/more-endpoints.md b/private-api/more-endpoints.md new file mode 100644 index 0000000..ec0ef79 --- /dev/null +++ b/private-api/more-endpoints.md @@ -0,0 +1,5 @@ +# More Endpoints + +To interact with Devices, Playlists, Plugin Settings, and other resources, see our Swagger docs: + +[https://usetrmnl.com/api-docs/](https://usetrmnl.com/api-docs/index.html)