As Pachube was recently acquired and relaunched under the name Cosm, many readers wondered whether my Pachube samples still work with Cosm.
I tried out the HelloPachube sample of my book, using my old API key and my original Pachube sample feed ID. The sample program was otherwise unchanged, and Gsiot.PachubeClient was completely unchanged, i.e., still sending to api.pachube.com.
Fortunately, this worked fine without problems.
I then tried to create an entirely new Cosm account "gsiot". As Cosm looks quite a bit different from Pachube, this can be a bit confusing.
You need to create a "secure sharing key" first, this will be the API key. You can find the key management page through the "Keys" icon, see the left red oval marker below:
After you have clicked on "Create", you will see an API key that you can copy into HelloPachube.
The other red oval marker above indicates where you can change some account settings.
After I had created a new Cosm feed and restarted HelloPachube with the API key and feed ID, this worked right away. How can I know? One, the Output window in Visual Studio told me that Cosm returned status code 200, which means OK. Two, the "voltage" datastream showed a value, in this case 0.15 V. Three, the "Last updated" mark (red oval marker in the screen shot below) showed that something happened (although confusingly, the displayed time seems to randomly jump between time zones).
Note: only the "voltage" datastream is updated, the "number" datastream is not used in the HelloPachube sample!
So yes, to my relief the code still works with Cosm!
Only two things changed in the API: it is now api.cosm.com instead of api.pachube.com, and the HTTP header is now X-ApiKey instead of X-PachubeApiKey.
For the human-readable (HTML) pages, it is now cosm.com (without www!) instead of www.pachube.com.