OctoPrint-Webhooks icon indicating copy to clipboard operation
OctoPrint-Webhooks copied to clipboard

Messages are only sending Topic and Message even when all DATA params are set

Open mtsouris81 opened this issue 4 years ago • 0 comments

I've tested webhooks and everything works with the test calls. I get empty objects for progress, state, etc, but that's fine, I can still see the structure of those objects. Something like this:

topic: Print Started
message: Your print has started
progress: {"completion": null, "filepos": null, "printTime": null, "printTimeLeft": null, "printTimeOrigin": null}
state: {"text": "Offline", "flags": {"operational": false, "printing": false, "cancelling": false, "pausing": false, "resuming": false, "finishing": false, "closedOrError": true, "error": false, "paused": false, "ready": false, "sdReady": false}, "error": ""}
job: {"file": {"name": null, "path": null, "size": null, "origin": null, "date": null}, "estimatedPrintTime": null, "lastPrintTime": null, "filament": {"length": null, "volume": null}, "user": null}
currentTime: 1635649547
all keys: deviceIdentifier, apiSecret, topic, message, extra, state, job, progress, offsets, meta, currentTime

however, when I run the server connected to the printer, I get the calls but only topic and message are populated. state, progress and job are completely null, not even empty objects, just not sent at all. I get this:



topic: Print Progress
message:  18 
progress: 
state: 
job: 
currentTime: 1635721418
all keys: deviceIdentifier, apiSecret, topic, message, extra, state, job, progress, currentZ, offsets, meta, currentTime

In my webhooks config, my data is the default setting, so it looks like this:


{
  "deviceIdentifier":"@deviceIdentifier",
  "apiSecret":"@apiSecret",
  "topic":"@topic",
  "message":"@message",
  "extra":"@extra",
  "state": "@state",
  "job": "@job",
  "progress": "@progress",
  "currentZ": "@currentZ",
  "offsets": "@offsets",
  "meta": "@meta",
  "currentTime": "@currentTime",
  "snapshot": "@snapshot"
}

And finally, a big dump of all the stuff sent with the request




topic: Print Progress
message:  38 
Request Params
   [deviceIdentifier] =     
   [apiSecret] =     
   [topic] =     Print Progress
   [message] =      38 
   [extra] =     {}
   [state] =     
   [job] =     
   [progress] =     
   [currentZ] =     
   [offsets] =     
   [meta] =     
   [currentTime] =     1635722107
   [ALL_HTTP] =     HTTP_CONNECTION:keep-alive
HTTP_CONTENT_LENGTH:71822
HTTP_CONTENT_TYPE:multipart/form-data; boundary=75b8518b1fa90aab01efd2c24878d10c
HTTP_ACCEPT:*/*
HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_HOST:DONT_WORRY_ABOUT_MY_HOSTNAME.com
HTTP_USER_AGENT:python-requests/2.26.0

   [ALL_RAW] =     Connection: keep-alive
Content-Length: 71822
Content-Type: multipart/form-data; boundary=75b8518b1fa90aab01efd2c24878d10c
Accept: */*
Accept-Encoding: gzip, deflate
Host: DONT_WORRY_ABOUT_MY_HOSTNAME.com
User-Agent: python-requests/2.26.0

   [APPL_MD_PATH] =     /LM/W3SVC/5/ROOT
   [APPL_PHYSICAL_PATH] =     C:\inetpub\wwwroot\DONT_WORRY_ABOUT_MY_HOSTNAME\
   [AUTH_TYPE] =     
   [AUTH_USER] =     
   [AUTH_PASSWORD] =     
   [LOGON_USER] =     
   [REMOTE_USER] =     
   [CERT_COOKIE] =     
   [CERT_FLAGS] =     
   [CERT_ISSUER] =     
   [CERT_KEYSIZE] =     256
   [CERT_SECRETKEYSIZE] =     3072
   [CERT_SERIALNUMBER] =     
   [CERT_SERVER_ISSUER] =     C=US, O=Let's Encrypt, CN=R3
   [CERT_SERVER_SUBJECT] =     CN=DONT_WORRY_ABOUT_MY_HOSTNAME
   [CERT_SUBJECT] =     
   [CONTENT_LENGTH] =     71822
   [CONTENT_TYPE] =     multipart/form-data; boundary=75b8518b1fa90aab01efd2c24878d10c
   [GATEWAY_INTERFACE] =     CGI/1.1
   [HTTPS] =     on
   [HTTPS_KEYSIZE] =     256
   [HTTPS_SECRETKEYSIZE] =     3072
   [HTTPS_SERVER_ISSUER] =     C=US, O=Let's Encrypt, CN=R3
   [HTTPS_SERVER_SUBJECT] =     CN=DONT_WORRY_ABOUT_MY_HOSTNAME
   [INSTANCE_ID] =     5
   [INSTANCE_META_PATH] =     /LM/W3SVC/5
   [LOCAL_ADDR] =     10.1.0.4
   [PATH_INFO] =     /home/PrintMessage
   [PATH_TRANSLATED] =     C:\inetpub\wwwroot\DONT_WORRY_ABOUT_MY_HOSTNAME\home\PrintMessage
   [QUERY_STRING] =     
   [REMOTE_ADDR] =     DONT_WORRY_ABOUT_MY_HOSTNAME
   [REMOTE_HOST] =     DONT_WORRY_ABOUT_MY_HOSTNAME
   [REMOTE_PORT] =     39054
   [REQUEST_METHOD] =     POST
   [SCRIPT_NAME] =     /home/PrintMessage
   [SERVER_NAME] =     DONT_WORRY_ABOUT_MY_HOSTNAME.com
   [SERVER_PORT] =     443
   [SERVER_PORT_SECURE] =     1
   [SERVER_PROTOCOL] =     HTTP/1.1
   [SERVER_SOFTWARE] =     Microsoft-IIS/10.0
   [URL] =     /home/PrintMessage
   [HTTP_CONNECTION] =     keep-alive
   [HTTP_CONTENT_LENGTH] =     71822
   [HTTP_CONTENT_TYPE] =     multipart/form-data; boundary=75b8518b1fa90aab01efd2c24878d10c
   [HTTP_ACCEPT] =     */*
   [HTTP_ACCEPT_ENCODING] =     gzip, deflate
   [HTTP_HOST] =     DONT_WORRY_ABOUT_MY_HOSTNAME.com
   [HTTP_USER_AGENT] =     python-requests/2.26.0
Request FORM
   [deviceIdentifier] =     
   [apiSecret] =     
   [topic] =     Print Progress
   [message] =      38 
   [extra] =     {}
   [state] =     
   [job] =     
   [progress] =     
   [currentZ] =     
   [offsets] =     
   [meta] =     
   [currentTime] =     1635722107
Request Headers
   [Connection] =     keep-alive
   [Content-Length] =     71822
   [Content-Type] =     multipart/form-data; boundary=75b8518b1fa90aab01efd2c24878d10c
   [Accept] =     */*
   [Accept-Encoding] =     gzip, deflate
   [Host] =     DONT_WORRY_ABOUT_MY_HOSTNAME.com
   [User-Agent] =     python-requests/2.26.0

mtsouris81 avatar Oct 31 '21 23:10 mtsouris81