Teleoh™ Cloud API Docs


SMS

  • SendMessage
  • GetAll
  • Get



  • SendMessage

    Send a SMS or MMS message to the specified phone number.

    Messages can only be sent 'from' a phone number purchased in your account.
    For broadcasting messages you can send up to one (1) message per second per Teleoh phone number.

    When sending MMS, the size of all images or video for a message should not exceed 1.5MB. If sending from a mobile to a Teleoh number the mobile carrier will usually handle changing the image file size on your behalf.

    POST/GET http://voiceapi.cloud/API/{format}/SMS/SendMessage
    

    Parameter Description Required
    API_USER_ID Your API User ID YES
    API_KEY Your API Key YES
    to The phone number to send the message to. Should include country code and the 10 digit number. YES
    from The phone number to send the message from. Must be a DID number purchased in your Teleoh account. YES
    text_message The text of your message. Must be 2048 characters or less. YES
    media_url For MMS messages only. The media (usually a image) you'd like to send. Should be a fully qualified domain name. Example: http://yoursite.com/yourimage.jpg NO
    callbackUrl URL that is notified via POST by Teleoh when the status of the SMS message changes.

    Fields:
    message_id = The ID of the message
    MessageAction = either 'delivered' or 'error'
    result = A description of the message status, such as "Message not delivered to carrier".
    NO

    JSON Response
    {
    	"sms": {
    		"@attributes": {
    			"message_id": "18787"
    		},
    		"to": "12144630000",
    		"from": "19723624569",
    		"text_message": "Test a message with the JSON API.",
    		"media_url": {}
    	}
    }
    

    XML Response
    <?xml version="1.0" encoding="UTF-8"?>
    <heg>
       <sms message_id="18789">
          <to>12144630000</to>
          <from>19723624587</from>
          <text_message>Testing a message with the XML API.</text_message>
          <media_url />
       </sms>
    </heg>
    
    


    GetAll

    Get all messages withing a specified date range.

    POST/GET http://voiceapi.cloud/API/{format}/SMS/GetAll
    

    Parameter Description Required
    API_USER_ID Your API User ID YES
    API_USER_KEY Your API Key YES
    start_date The start date of your search range formatted as YYYY-MM-DD YES
    end_date The end date of your search range formatted as YYYY-MM-DD YES
    max The maximum number of results to return. The default is 100 and the the max is 500. NO
    to The 'to' number. Provide this attribute to view messages sent only to this number. Only part of the 'to' number can be provided for a search like experience. NO
    from The 'from' number. Provide this attribute to view messages sent only from this number. Only part of the 'from' number can be provided for a search like experience. NO

    JSON Response
    {
    	"sms": [{
    		"@attributes": {
    			"message_id": "15"
    		},
    		"send_date": "2016-08-30 19:07:07",
    		"direction": "outbound",
    		"to": "12144630000",
    		"from": "19723625216",
    		"text_message": "This is the text of the SMS.",
    		"media_url": {},
    		"callbackUrl": "http:\/\/myurl.com\/sms_callback.php",
    		"rate": "0.01",
    		"total_billed": "0.01",
    		"status": "DELIVERED",
    		"status_description": "Message delivered to carrier"
    	}, {
    		"@attributes": {
    			"message_id": "16"
    		},
    		"send_date": "2016-08-30 19:09:05",
    		"direction": "outbound",
    		"to": "12144630000",
    		"from": "19723625216",
    		"text_message": "Sending my last SMS message.",
    		"media_url": {},
    		"callbackUrl": "http:\/\/myurl.com\/sms_callback.php",
    		"rate": "0.01",
    		"total_billed": "0.01",
    		"status": "DELIVERED",
    		"status_description": "Message delivered to carrier"
    	}]
    }
    

    XML Response
    <?xml version="1.0" encoding="UTF-8"?>
    <heg>
       <sms message_id="15">
          <send_date>2016-08-30 19:07:07</send_date>
          <direction>outbound</direction>
          <to>12144630000</to>
          <from>19723625216</from>
          <text_message>Sending my first SMS</text_message>
          <media_url />
          <callbackUrl>http://myurl.com/sms_callback.php</callbackUrl>
          <rate>0.01</rate>
          <total_billed>0.01</total_billed>
          <status>DELIVERED</status>
          <status_description>Message delivered to carrier</status_description>
       </sms>
       <sms message_id="16">
          <send_date>2016-08-30 19:09:05</send_date>
          <direction>outbound</direction>
          <to>12144630000</to>
          <from>19723625216</from>
          <text_message>Sending my second SMS.</text_message>
          <media_url />
          <callbackUrl>http://myurl.com/sms_callback.php</callbackUrl>
          <rate>0.01</rate>
          <total_billed>0.01</total_billed>
          <status>DELIVERED</status>
          <status_description>Message delivered to carrier</status_description>
       </sms>
    </heg>
    


    Get

    Get the details of a single message_id.

    POST/GET http://voiceapi.cloud/API/{format}/SMS/Get
    

    Parameter Description Required
    API_USER_ID Your API User ID YES
    API_KEY Your API Key YES
    message_id The message_id of the message you'd like to get the details of. YES

    JSON Response
    {
      "sms": {
        "message_id": "16",
        "send_date": "2016-08-30 19:09:05",
        "direction": "outbound",
        "to": "12144630000",
        "from": "19723625216",
        "text_message": "Sending my second SMS.",
        "callbackUrl": "http://myurl.com/sms_callback.php",
        "rate": "0.01",
        "total_billed": "0.01",
        "status": "DELIVERED",
        "status_description": "Message delivered to carrier"
      }
    }
    

    XML Response
    <?xml version="1.0" encoding="UTF-8"?>
    <heg>
      <sms message_id="16">
          <send_date>2016-08-30 19:09:05</send_date>
          <direction>outbound</direction>
          <to>12144630000</to>
          <from>19723625216</from>
          <text_message>Sending my second SMS.</text_message>
          <media_url />
          <callbackUrl>http://myurl.com/sms_callback.php</callbackUrl>
          <rate>0.01</rate>
          <total_billed>0.01</total_billed>
          <status>DELIVERED</status>
          <status_description>Message delivered to carrier</status_description>
       </sms>
    </heg>