Losant to Digital Ocean MySQL help


Looking for some assistance on how to shoot device data (which we have going to losant data table successfully) to a digital ocean MySQL instance.
Any suggestions?

Special points for helping us then also round trip some data from same SQL database back to Losant.


Are you able to run a simple application on the Digital Ocean side? If so, that’s the way to go.

To get data from Losant to the Digital Ocean MySQL database, use the HTTP Node to send a POST request to a URL where your application is listening, and include the data to be inserted in the post body. Your application on Digital Ocean takes care of parsing that data, opening the connection to your MySQL database, and inserting the row. And since this endpoint would be exposed to the Internet, you’d want to put some sort of authorization framework in front of it, which the HTTP Node also supports.

As for getting data from Digital Ocean to Losant …

  1. Create a new Experience User and add the user to a new group called “Digital Ocean MySQL”.
  2. Set up an Experience Endpoint with a method of POST and with Access Control of “Only users who are in the following groups …” Select your “Digital Ocean MySQL” group.
  3. Create a cloud workflow and string together a Virtual Button, Generate Token and Debug Node. Click the virtual button, then view the output in the debug log and copy the newly created token. You’ll need this in a later step.
  4. In your Digital Ocean application, set it up to fire a POST request to the Losant endpoint you previously created. Include a header of Authorization: Bearer [THE_TOKEN_YOU_COPIED] and put the data you want inserted into Losant into the request body in a JSON format.
  5. In a cloud workflow (it can even be the same one you created to generate the token, add an Endpoint Trigger configured to fire when requests are made to the previously created endpoint. Connected to that trigger should be whatever nodes are necessary to parse the post body and insert the data into Losant.

Let us know if you have any questions!


Great thanks Dylan will give this a try