I can’t create a webhook. I’ve installed the node.js cli, opened, started and entered: npm install -g particle-cli, then particle login… I then entered a webhook create command using the example from the Particle documentation and the response I’m receiving is:
C:\Users\Don>particle webhook create slack.json
slack.json is not found.
C:\Users\Don>particle webhook list
Found 0 hooks registered
@DGG-KY, you need to either explicitly specify the path of the .json file in the particle command or switch to the directory where it can be found and call particle from there.
particle create webhook c:\users\don\xxxx\slack.json
where xxxx is the directory where slack.json is located, possibly documents
OR
cd c:\users\don\xxxx
particle create webhook slack.json
@DGG-KY, I think you need to read or re-read the webhooks section of the documentation. The file is created by you! I suspect you are trying to follow the example in the tutorial but there is no such file!
peekay, I’ve read webhooks section numerous times before screaming help! In my previous response you can see the line where I attempt to create the file, C:\Users\Don.spark>particle webhook create slack.json
but I get an error:
Error loading command C:\Users\Don\AppData\Roaming\npm\node_modules\particle-cli\commands\SerialCommand.js Error: Cannot find module 'node-pre-gyp’ slack.json is not found.
I’ve executed an example.js file to print out “Hello World” (per node.js cli) to see if I am communicating with the server or even if the cli is recognizing my commands. The last line of the example.js file prints but not the message ‘Hello World’. I don’t know what I’m missing.
You need to manually create the json file by hand in a text editor. The json file is the configuration data for the webhook you are trying to create. The command “particle webhook create xxx.json” does NOT create the json file, it creates the webhook using the json file as input data.
@DGG-KY, the slack.json is a text file that YOU create. You then use the particle webhook create command to create a webhook FROM that file. Though the slack.json file is referred to in the docs, there is no such file. I suggest you try the weather or librato webhook examples though again, you will need to create the .json file from which you create a webhook. For example, in my RGBPongClock topic, I created a .json file with the following text:
First in response to ScruffR: I have ZERO experience and I am trying to learn by reading and executing examples using two Particle Photons. Thank you for help.
Second in response to cyberlord: I totally did not understand it was necessary to create first the slack.json file and a webhook file from the particle documentation. Thank you for clearing that up.
Third in response to peekay123: I must have jumped ahead and completely missed instructions on how to create a .json file. There are so many twists and turns, I’m trying to learn and it is extremely confusing. Between all of you, perhaps I have enough information to continue researching how to do this. Thanks to all