Jump to content









Photo

Listener help

sms listener alert

  • Please log in to reply
3 replies to this topic

#1 billwatson

billwatson

    Member

  • Members
  • PipPip
  • 14 posts

Posted 18 October 2015 - 02:30 AM

Hi All,

 

I'm having some trouble getting an sms listener to send a text to my Australian number.

lets say it's 0430941769.   Any chance you could pass your peepers over this to see if it's correct?

I'm not getting anything through.  My 'if' expression is good as I have tested it out on an email listener and it works fine.  Thanks so much for your time.

 

Here's my then expression:

 

    import com.carriots.sdk.utils.Sms;
     
    def sms = new Sms();
    sms.to="0061430941769";  
    sms.message="Coldroom temperature below 4 degrees";
 
    sms.send();

 

 



#2 snehal.jabade

snehal.jabade

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 09 March 2016 - 10:41 AM

Does anyone know how to create listener which sends an email using REST API?



#3 sdeancos

sdeancos

    Master of Puppets

  • Members
  • PipPipPip
  • 103 posts
  • LocationMadrid, Spain.

Posted 10 March 2016 - 01:50 PM

Hi,

You can use the API Rest for to create a Listener, you can learn more in https://www.carriots...ules_management

I hope this help you.
BR



#4 Yoleon

Yoleon

    Sugar Master

  • Members
  • PipPipPip
  • 31 posts

Posted 15 March 2016 - 12:59 PM

Hi,

 

You can use this sample code to create a listener to send an email:

 

Host: https://api.carriots.com/listeners/
Content-Type: application/json
Carriots.apiKey: Your API KEY

{
    "name": "Listener_RESTAPI",
    "description": "REST API Listener",
    "event": "data_received",
    "enabled": true,
    "entity": {
        "entity_type": "Device",
        "id": "defaultDevice@Customer.Customer"
    },
    "if_expression": "true",
    "then_expression": "import com.carriots.sdk.utils.Email;\ndef email = new Email ();\nemail.to= your email;\nemail.subject= \"RFID reader\";\nemail.message=\"RFID reader. Card read: \"+context.data.tag;\nemail.send();"
}

 

I hope this help you.

 

Carriots Staff







Also tagged with one or more of these keywords: sms, listener, alert

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users