Sending data via HTTP

Sending data from a cellular modem to webhook.site

Reference: webhook.site

This tutorials is created for the u-blox R412 modem

  1. Set up the base url using +UHTTP:

    AT+UHTTP=0,1,"webhook.site"
    
  2. Set custom header(s) (optional):

    AT+UHTTP=0,9,"1:Content-Type:application/json"
    
  3. Create JSON file: sensordata.json

    AT+UDWNFILE="sensordata.json",19
    > {"temperature": 21}
    
  4. Read file:

    AT+URDFILE="sensordata.json"
    
  5. Send data:

    AT+UHTTPC=0,4,"<webhook.site path>","data.txt","sensordata.json",4
    
  6. Read server response:

    AT+URDFILE="data.txt"
    
  7. Delete sensordata.json (optional)

    AT+UDELFILE="sensordata.json"
    
  8. Visit webhook.site to see you message appear:

1 Like

Sending data to IFTTT

Reference: IFTTT

  1. Create an account on IFTTT.com
  2. Create a new Applet by clicking the button: Create
  3. If This:
    1. Create a webhook

    2. Select: “Receive a web request with a JSON payload”.
    3. Create an event name
  4. Than That:
    1. Select any option you like, such as sending an automated tweet, email or SMS.
  5. To find the IFTTT url to send an HTTP POST to, visit ifttt.com/maker_webhooks
    1. Click Documentation
    2. Make sure to embed your event name in the url
  6. Go through the same steps as with the previous post: Sending data to webhook.site, but use the base url and path from IFTTT.

To integrate your data with Ubidots using UDP or HTTP, have a look at the detailed documentation here.