Main Content

Plugins App

Plugins enable you to use HTML, CSS, and JavaScript® to display custom visualizations and controls on the private view of a channel.

Note

Plugins can be seen only on private views of a channel. Use MATLAB® Analysis or MATLAB Visualizations to create content to display on your public view.

Create a Plugin

  1. Select Apps > Plugins.

  2. Click New to create a new plugin.

  3. Select one of the Templates.

    • Custom: Create a plugin with your own code.

    • Chart With Multiple Series: Create a chart with a series for each field in your channel. Add your modifications to the template code.

    • Google Gauge: Create a Google® gauge on the ThingSpeak™ platform. Modify the Google gauge code to display your custom gauge.

  4. Click Create.

Plugin Options

  • Name: Enter a name.

  • HTML: Enter HTML code. The HTML window is the main window for your plugin code. You can separate your JavaScript code into the bottom window on the plugin page. ThingSpeak inserts the code from the JavaScript section into the generated HTML where you use the replacement key %%PLUGIN_JAVASCRIPT%%.

  • CSS: Enter CSS styles.

  • JavaScript: Enter JavaScript code. You can use the replacement key %%PLUGIN_JAVASCRIPT%% in the HTML section. ThingSpeak replaces this key with your JavaScript code.

  • Add this Visualization to a Channel: Select channels to include this plugin on their private view.

  • Save: Save the plugin.

  • Delete: Delete the plugin.

  • My Channels: This tab displays this information about your saved channels:

    • Channel name

    • Channel ID

    • Write and Read API keys

    • Channel fields

  • New Channel: Create a new channel.

List My Plugins

JSON

To view a list of your plugins, send an HTTP GET to

https://api.thingspeak.com/apps/plugins.json?api_key=XXXXXXXXXXXXXXXX

Valid parameters:

  • api_key (string) - Your account API key, which can be found in your account settings. (required)

Example

GET https://api.thingspeak.com/apps/plugins.json?api_key=XXXXXXXXXXXXXXXX

The response is a JSON object of your plugins, for example:

[
    {
      "id": 8,
      "name": "google gauge",
      "created_at": "2014-01-05T16:35:26-05:00",
      "public_flag": false,
      "username": "iothans",
      "url": "https://thingspeak.com/apps/plugins/8"
    },
    {
      "id": 13,
      "name": "Plugin 13",
      "created_at": "2014-10-09T14:45:31-04:00",
      "public_flag": false,
      "username": "iothans",
      "url": "https://thingspeak.com/apps/plugins/13"
    }
  ]

XML

To view a list of your plugins, send an HTTP GET to

https://api.thingspeak.com/apps/plugins.xml?api_key=XXXXXXXXXXXXXXXX

Valid parameters:

  • api_key (string) - Your account API key, which can be found in your account settings. (required)

Example

GET https://api.thingspeak.com/apps/plugins.xml?api_key=XXXXXXXXXXXXXXXX

The response is an XML object of your plugins, for example:

<response>
  <pagination>
    <current-page type="WillPaginate::PageNumber">1</current-page>
    <per-page type="integer">15</per-page>
    <total-entries type="integer">2</total-entries>
  </pagination>
  <plugins type="array">
    <plugin>
      <id type="integer">8</id>
      <name>google gauge</name>
      <created-at type="dateTime">2014-01-05T16:35:26-05:00</created-at>
      <public-flag type="boolean">false</public-flag>
      <username>iothans</username>
      <url>https://thingspeak.com/apps/plugins/8</url>
    </plugin>
    <plugin>
      <id type="integer">13</id>
      <name>Plugin 13</name>
      <created-at type="dateTime">2014-10-09T14:45:31-04:00</created-at>
      <public-flag type="boolean">false</public-flag>
      <username>iothans</username>
      <url>https://thingspeak.com/apps/plugins/13</url>
    </plugin>
  </plugins>
</response>

Related Topics