You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(not really an issue, more a question for understanding)
Hi,
First of all, many thanks for sharing this. When looking at the code I was wondering something:
In Ciscospark.php you get all the message details but only pass on the message ID to
the sparkmess.py script, where you access spark to pull in the same details
Would it make sense to pass on all details coming in through the Webhook and pass these to sparkmess.py so this doesn't have to go out to Spark and get it again?
Cheers
DJ
The text was updated successfully, but these errors were encountered:
Thank you for the feedback and taking a look. I am hoping this will help others start playing with the API.
Short answer is I needed to grab the message details to get the message text due to Spark's secure implementation (For reference: https://developer.ciscospark.com/webhooks-explained.html). When I grab the message details I am getting the roomid so no need to pass. On my first version I actually did pass the roomid as well. I may need to update these examples, FYI, ran into a couple of issues:
If you pull your AT from a file, make sure to rstrip() to eleiminate a trailing "/n" or Spark may through a JSON parse error
If a room contains attachments without text, python will through an error because it sees dictionary entries without a 'text' key. So you need to check if the key exists before printing, assigning a variable to it, etc...
Also let me know if there are any methods you want me to add - I threw in a quick find roomid by room name and suspect there may be similar common actions it would help to have in the library directly.
..."I am hoping this will help others start playing with the API."...
Yes you did... Using this code I wrote a "bot" that connects to my house (security camera's, power usage, water usage, etc.etc.)
(not really an issue, more a question for understanding)
Hi,
First of all, many thanks for sharing this. When looking at the code I was wondering something:
Would it make sense to pass on all details coming in through the Webhook and pass these to sparkmess.py so this doesn't have to go out to Spark and get it again?
Cheers
DJ
The text was updated successfully, but these errors were encountered: