Skip to main content
1-Visitor
April 19, 2016
Solved

Remotely configuring a thingTemplate/thing via rest

  • April 19, 2016
  • 3 replies
  • 2274 views

Hi,

I noticed some ThingTemplates have a configuration section. Say, for example, the mail extension or mqtt extension.

I know you can create, enable, and start/stop things through rest, and even give them a template, however is there a way to remotely set these configuration settings. Perhaps via REST or another method.

For example, in the mail extension's configuration settings: Can you remotely set (i.e. from PC) the mail server address, user details etc.

Kind regards,

John

Best answer by jpytlowany

I realized my syntax was wrong. The problem is resolved. I can provide an example at a later time

3 replies

5-Regular Member
April 20, 2016

John, you can create a Mashup for this as well. For example, if you take the MailServer Thing, you can use a service like GetConfigurationTable and bind that to a Grid. The tableName would be ConnectionInfo, and that would display all fields in the configuration section.

1-Visitor
April 21, 2016

Hi, Thanks for the info.

So i have a javascript application try to call the service "SetConfigurationTableRows",

my input is:

var data = {

  "tableName":"Mail Server Connection Parameters",

  "values" : {

  "dataShape" : {

  "fieldDefinitions": {

  "SMTP Server":{

  "name":"SMTP Server"

  }}},

  "rows":[{"SMTP Server":"localhost"}]

  }

};

Im getting an error. (406, specifically).

Should it be something more like,

var data = {

  "tableName":"Mail Server Connection Parameters",

  "values" : {

  "dataShape" : {

  "fieldDefinitions": {

  "SMTP Server"}},

  "rows":[{"SMTP Server":"localhost"}]

  }

};

??

Im am using POST method.

Regards,

John

jpytlowany1-VisitorAuthorAnswer
1-Visitor
April 21, 2016

I realized my syntax was wrong. The problem is resolved. I can provide an example at a later time