I’ve batted my head against the desk enough with this, so want to see if someone else knows what’s going on. This is my first smartapp. I’m working on getting ST connected to a python app running on my RPi so that I can control a few ancillary devices through custom code.
So I went through the install instructions here: https://smartthings.developer.samsung.com/develop/guides/smartapps/app-registration.html
When I go to create the app by doing the CURL request (which I’m doing in python), I get the below. As you can see, I am POSTing the app as specified, and then a request comes in to do the PING which I respond to, but then in the response of the app creation POST I get a constraints violation with something about a classification and I can’t find anywhere that is even referenced? Any help would be much appreciated!
POST https://api.smartthings.com/v1/apps
Authorization: Bearer <my_token>
Content-Type: application/json; charset=utf-8
Content-Length: 241
{"appName": "tech.blah.blah.blah", "displayName": "home-automation", "description": "Made by someone", "appType": "WEBHOOK_SMART_APP", "webhookSmartApp": {"targetUrl": "https://<my_hostname>/ha/smartthings/webhook"}}
Now incoming POST request comes in…
Host: <my_hostname>
Connection: close
Content-Length: 183
Content-Type: application/json
Accept: application/json
User-Agent: AHC/2.1
{"lifecycle":"PING","executionId":"1B363EDC-E4C0-477E-B9DA-B432626D8F54","locale":"en","version":"0.1.0","pingData":{"challenge":"#####CHALLENGE#####"},"settings":{}}
2019-03-04 05:20:36 - Handling SmartThings lifecycle method PING
Responding with HTTP 200: {'pingData': {'challenge': '#####CHALLENGE#####'}}
2019-03-04 05:20:36 - 192.168.1.123 - - [04/Mar/2019 05:20:36] "POST /smartthings/webhook HTTP/1.0" 200 -
Now I get the response of the app POST request… classifications is no where to be mentioned??
{"requestId":"1B363EDC-E4C0-477E-B9DA-B432626D8F54","error":{"code":"ConstraintViolationError","message":"The request is malformed.","details":[{"code":"SizeError","target":"classifications","message":"classifications must have a size between 1 and 4.","details":[]}]}}