Particle and REST API for IoT cloud data transfer

Hi, everyone.

I have some question to ask.
I have tried to post my temperature measurement to ThingSpeak (as one of the IoT cloud platform).
And it’s working perfectly. Plus, ThingSpeak use REST API protocol and the code is already in the particle Library.

Now, I want to use another IoT platform that used the same protocol as ThingSpeak. But I got some problem.
I just need anyone opinions on how to develop Particle with other REST API protocol other than ThingSpeak.


@Syerlac - we will need more details.

Which device are you developing on? Photon, Electron, P0, P1?

What platform are you using for development: Windows, Mac or Linux?

Any information on the new REST API target? You can say most IoT things use REST, but the structure of the API can be different. If the API calls to the new target are similar to the ThinkSpeak calls, then we can say it is similar.

How do you like to develop?

There are a handful of development options:

  • Web based IDE (build) platform : Web GUI : nice if you want to keep all the code in the Particle cloud. The only drawback here is if you want to work on a private copy of the ThinkSpeak library to get it to work with your new target. Once you do that, then you can develop the project code on the Web IDE. To work with libraries, you need to also use Particle CLI to setup a private copy of a library for modification. Once you do that, you may need to edit the code locally on your machine and upload the library each time for testing.

  • Particle CLI. This provides command line access to similar tools as the Web IDE. Compiling still requires the Particle cloud. This allows you to manage project and library code.

  • Particle DEV or Desktop IDE: GUI version of the Particle CLI or a local copy of the Web IDE.

  • local toolchain: command line with Makefile for Windows, Mac and Linux. For me, this is the “classic” style I am used to for open source projects. Once tools are in place, you are not dependent on the Particle cloud to produce firmware for your target device. You will have to manually manage your project code and libraries. Once you have something working here, again you will need to switch to the Particle CLI to upload code if you want to share it with other Web IDE users.

  • po-utils : I have not personally worked with it, so I can’t provide any useful feedback. It looks like a powerful upgrade to the Particle CLI and local toolchain.

It is always helpful to create a github repo that you can point people too if the code gets too large. Likewise you can provide a pull request, if you forked/copied someones code and have any useful improvements.

Posting code snippets in the forum with errors and such are welcome.

1 Like

@cermak thank you for the reply.

I used Particle Photon and I’m using Windows 8.

Regarding below…

I just find out when you reply this message. :scream:
So, I guess I should know the structure.
@cermak, maybe you can guide me about the types of REST API structure…:grin:

Yes, I want to develop the code in Particle IDE online. Same as the development of ThingSpeak coding in Particle’s Library.

I still not done the code yet. Just use the ThingSpeak code in the library.

Let me ask a different way. You have code working for ThingSpeak which is from company A. What is the other REST API service you are trying to use from company B? Is there documentation we can look at? So, the ThingSpeak library will talk to specific services for that company. Although the API calls might be the same, you will have to change the server it is trying to connect to use the REST API services from company B.