Sms Receiving (MO)

Endpoint: https://api.smsdev.com.br/v1/inbox

Method: POST, GET ou JSON

Description: This method is used to consult the responses received.

NOTE: that the parameter status defines whether the method returns all messages received or only new messages not yet read by the API.


Description of parameters

First Name & Last name Type Standard Required Description
key text yes Account authentication key.
status number 0 not Response status: 0-Only new responses; 1-All answers.
date_from text not Start date for Ex filter: '01 / 01/2020 ′.
date_to text not End date for Ex filter: '02 / 01/2020 ′.
id array number not Unique ID of the sending message (MT).

Was this article helpful to you?

  • MO (Answers) - Charge 1 credit for every 160 characters.
  • It is possible to disable responses.
			

{
	"key" : "XXXXXXXXXXXXXXXXXXXX",
	"status" : 0,
	"date_from" : "01/01/2020",
	"date_to" : "30/01/2020",
	"id" : [999999,888888,777777]
}

				
			
		
			
				https://api.smsdev.com.br/v1/inbox?key=SUA_CHAVE_KEY&status=1
				
			
			
    

Copy and paste in the browser

			
curl --request GET \
  --url 'https://api.smsdev.com.br/v1/inbox?key=SUA_CHAVE_KEY&status=1'

		
			
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.smsdev.com.br/v1/inbox?key=SUA_CHAVE_KEY&status=1",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_SSL_VERIFYHOST => 0,
  CURLOPT_SSL_VERIFYPEER => 0,
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

?>
	
		
			
HttpResponse<String> response = Unirest.get("https://api.smsdev.com.br/v1/inbox?key=SUA_CHAVE_KEY&status=1").asString();


		
			

	var http = require("http");

var options = {
			"method": "GET",
			"hostname": "api.smsdev.com.br",
			"port": null,
			"path": "/v1/inbox?key=SUA_CHAVE_KEY&status=1",
			"headers": {}
		};

		var req = http.request(options, function (res) {
			var chunks = [];

			res.on("data", function (chunk) {
				chunks.push(chunk);
			});

			res.on("end", function () {
				var body = Buffer.concat(chunks);
				console.log(body.toString());
			});
		});

		req.end();

	
		
The above method returns code in the pattern below
		
	[ 
   { 
      "situacao":"OK",
      "data_read":"01\/01\/2020 11:35:14",
      "telefone":"5511988887777",
      "id":"",
      "refer":"",
      "msg_sent":"",
      "id_sms_read":"2515973",
      "descricao":"Reposta 1"
   },
   { 
      "situacao":"OK",
      "data_read":"01\/01\/2020 11:36:11",
      "telefone":"5521977776666",
      "id":"",
      "refer":"",
      "msg_sent":"",
      "id_sms_read":"2515974",
      "descricao":"Reposta 2"
   },
   { 
      "situacao":"OK",
      "data_read":"01\/01\/2020 11:39:24",
      "telefone":"556288887777",
      "id":"",
      "refer":"",
      "msg_sent":"",
      "id_sms_read":"2515975",
      "descricao":"Reposta 3"
   }
]
		
	
Return description
First Name & Last name Description
situation “OK” - Successful submission
"ERROR" - Submission with error
data_read Date of receipt of the response dd / mm / yyyy hh24: mi: ss.
phone Phone that sent the answer 5511988887777.
id Unique ID of the sending message (MT).
refer REFER identifier passed in the sending message (MT).
msg_sent Text of the sent message (MT).
id_sms_read Unique ID of the received message (MO).
description Text of the received message (MO).