Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| en:mervis-ide:65-webpanel:webpanel-api [2017/06/21 13:29] m.chlupac [Response] | en:mervis-ide:65-webpanel:webpanel-api [2024/05/08 10:42] (current) | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ==== Request ==== | ==== Request ==== | ||
| - | Data | + | **URL:** '' | 
| - | < | + | |
| + | < | ||
| ver : 1,//version | ver : 1,//version | ||
| //optional - only for non-authenticated access | //optional - only for non-authenticated access | ||
| // | // | ||
| - | c: {u: “karel”, p: “x”} | + | c: {u: "karel", p: "x"} | 
| }</ | }</ | ||
| ==== Response ==== | ==== Response ==== | ||
| - | < | + | < | 
| ver : 1,//version | ver : 1,//version | ||
| - | code: “ok”, //return code | + | code: "ok", //return code | 
| - | msg: “”, //error message | + | msg: "" | 
| - | c : {u: “karel”, p:”x”} //must be used for further communication | + | c : {u: "karel", p:"x"} //must be used for further communication | 
| }</ | }</ | ||
| Line 28: | Line 29: | ||
| ==== Request ==== | ==== Request ==== | ||
| - | Data | + | **URL:** '' | 
| - | < | + | |
| + | < | ||
| ver : 1,//version | ver : 1,//version | ||
| //optional - only for non-authenticated access | //optional - only for non-authenticated access | ||
| // | // | ||
| - | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, | 
| //variable IDs | //variable IDs | ||
| - | v: [ “svc:// | + | v: [ "svc:// | 
| - | “svc:// | + | "svc:// | 
| }</ | }</ | ||
| * variable ID is unique string - in future, may be different for different platforms/ | * variable ID is unique string - in future, may be different for different platforms/ | ||
| - | === Variable specification for RT2 === | + | === Example === | 
| + | |||
| + | <code javascript> | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Variable specification for Mervis RT === | ||
| * svc - protocol | * svc - protocol | ||
| Line 51: | Line 68: | ||
| the POST body can be: | the POST body can be: | ||
| - | - JSON string (AngularJS default behaviour): | + | - JSON string (AngularJS default behaviour): < | 
| - | < | + | - converted into POST parameters (jQuery default behaviour):< | 
| - | - converted into POST parameters (jQuery default behaviour): | + | |
| - | < | + | |
| - | The best solution would be to support both versions. Easier is now the JSON string. | ||
| ==== Response ==== | ==== Response ==== | ||
| - | < | + | < | 
| ver : 1,//version | ver : 1,//version | ||
| code: " | code: " | ||
| Line 75: | Line 89: | ||
| === Encoding of values - version 1 === | === Encoding of values - version 1 === | ||
| - | Ea | + |  | 
| + | |||
| + | === Example === | ||
| + | |||
| + | <code javascript> | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | : " | ||
| + | " | ||
| + | }, { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ] | ||
| + | }</ | ||
| ===== Command Request ===== | ===== Command Request ===== | ||
| Line 81: | Line 122: | ||
| ==== Request ==== | ==== Request ==== | ||
| + | **URL:** '' | ||
| - | < | + | < | 
| ver : 1,//version | ver : 1,//version | ||
| // | // | ||
| // | // | ||
| - | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, | 
| v: [{ | v: [{ | ||
| - |  | + |  | 
| // | // | ||
| - |  | + |  | 
| - |  | + |  | 
| - |  | + |  | 
| // | // | ||
| set: 5, | set: 5, | ||
| - | // | + | // | 
| // | // | ||
| - |  | + |  | 
| } | } | ||
| ] | ] | ||
| Line 108: | Line 150: | ||
| ==== Request ==== | ==== Request ==== | ||
| - | < | + | **URL:** '' | 
| + | |||
| + | < | ||
| ver : 1,//version | ver : 1,//version | ||
| // | // | ||
| // | // | ||
| - | c: {u: “karel”, p: “x”}, | + | c: {u: "karel", p: "x"}, | 
| - | v: [ {i:“svc:// | + | v: [ {i:"svc:// | 
| from: XXXX, | from: XXXX, | ||
| to: YYYY | to: YYYY | ||
| }, | }, | ||
| - | {i:“svc:// | + | {i:"svc:// | 
| from: XXXX, | from: XXXX, | ||
| to: YYYY | to: YYYY | ||
| Line 124: | Line 168: | ||
| }</ | }</ | ||
| + | ==== Response ==== | ||
| - | + | < | |
| - | ===== Configuration Response ===== | + | "ver": 1, | 
| - | + | " | |
| - | < | + | " | 
| - | ver : 1,//version | + | " | 
| - | platform: “uPLC”, | + | " | 
| - | maxVariablesInRequest: 5, | + | " | 
| - | maxRequestSize: 1500, //http body size in bytes | + | " | 
| - | preferedLanguage: “en-US” | + | " | 
| - | }</ | + | }, | 
| - | + | { | |
| + | " | ||
| + | " | ||
| + | }], | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + |  | ||
| + | }] | ||
| + | } | ||
| + | </ | ||