Hello,
I have a problem using the Pimatic API. Firstly I try to get the Informations to a special device, in this case a switch. In the browser (Firefox) I’ve entered “https://<pimatic URL>/api/devices/schiefelampe” and get the JSON Object of the switch device back.
However, if I send this via curl with the following command:
curl -X GET https://<USER>:<PASSWORD>@<pimatic URL>/api/devices/schiefelampe
I only get the following error message:
TypeError: Cannot read property ‘set’ of undefined
at unauthorized (/opt/pimatic-app/node_modules/pimatic/lib/framework.coffee:336:14)
at /opt/pimatic-app/node_modules/pimatic/lib/framework.coffee:357:11
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at _cookieSession (/opt/pimatic-app/node_modules/pimatic/node_modules/cookie-session/index.js:124:5)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at jsonParser (/opt/pimatic-app/node_modules/pimatic/node_modules/body-parser/lib/types/json.js:103:7)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at urlencodedParser (/opt/pimatic-app/node_modules/pimatic/node_modules/body-parser/lib/types/urlencoded.js:91:7)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at cookieParser (/opt/pimatic-app/node_modules/pimatic/node_modules/cookie-parser/index.js:56:14)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at /opt/pimatic-app/node_modules/pimatic/lib/framework.coffee:261:9
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at /opt/pimatic-app/node_modules/pimatic/node_modules/connect-timeout/index.js:64:5
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at expressInit (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/middleware/init.js:33:5)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at query (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/middleware/query.js:44:5)
at Layer.handle [as handle_request] (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:312:13)
at /opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:330:12)
at next (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:271:10)
at Function.handle (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/router/index.js:176:3)
at EventEmitter.handle (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/application.js:173:10)
at Server.app (/opt/pimatic-app/node_modules/pimatic/node_modules/express/lib/express.js:38:9)
at emitTwo (events.js:87:13)
at Server.emit (events.js:172:7)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:533:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)
I really have no Idea what I’m doing wrong in the CURL command.