API SMS

Intégrez Primotexto à vos applications grce à notre puissante API SMS.

  >  
SMS  >  

Statut d'un message par numéro de mobile (0600000000)

Requête à envoyer

URL

https://api.primotexto.com/v2/messages/status?identifier=%2B33600000000
%2B33600000000 = urlencode(+33600000000)

HTTP METHOD

GET

HEADERS

X-Primotexto-ApiKey: YOUR_API_KEY Content-Type: application/json

Retour de l'API


HEADERS

HTTP/1.1 200 OK Date: Fri, 08 Jan 2016 15:11:02 GMT Server: Apache Content-Type: application/json;charset=UTF-8 Vary: Accept-Encoding Transfer-Encoding: chunked

DATA

{ "delivered": 1387808142057, "id": 362891, "sent": 1387808111339, "state": "delivered", "stateDate": 1387808142057, "submitted": 1387808111833, "test": false }
State
Description
sent
Message envoyé (acquittement opérateur)
submitted
Message envoyé (sans aquittement opérateur)
delivered
Message re�u (accusé de récéption opérateur)
unsubscribed
Le destinataire du message s'est désinscrit (STOP SMS)
bounced
Le destinataire du message est un numéro non-attribué
opened
Le destinataire du message a ouvert un lien tracké
reply
Le destinataire du message a répondu
error
Le message n'est pas arrivé à destination
// Download library -> https://www.primotexto.com/api/librairies/latest-php.asp require_once 'primotexto-api-php/baseManager.class.php'; // Authentication authenticationManager::setApiKey('YOUR_API_KEY'); // Status by identifier $msg = new Query; $msg->type = 'notification'; $msg->identifier = '+33600000000'; messagesManager::messagesStatus($msg);
curl -X GET \ -H "X-Primotexto-ApiKey: YOUR_API_KEY" \ https://api.primotexto.com/v2/messages/status?identifier=%2B33600000000
// Download library -> JDK 1.5 : https://www.primotexto.com/api/librairies/latest-jdk-1.5.zip // Download library -> JDK 1.6 : https://www.primotexto.com/api/librairies/latest-jdk-1.6.zip // Download library -> JDK 1.7 : https://www.primotexto.com/api/librairies/latest-jdk-1.7.zip import com.primotexto.*; // Authentication AuthenticationManager.setApiKey("YOUR_API_KEY"); // Status by identifier PTQuery msg = new PTQuery(); msg.setType("notification"); msg.setIdentifier("+33600000000"); MessagesManager.messagesStatus(msg);
// Download library -> .NET 4.0 : https://www.primotexto.com/api/librairies/latest-net-4.0.asp // Download library -> .NET 4.5 : https://www.primotexto.com/api/librairies/latest-net-4.5.asp using Primotexto; // Authentication AuthenticationManager.setApiKey("YOUR_API_KEY"); // Status by identifier PTQuery msg = new PTQuery(); msg.setType("notification"); msg.setIdentifier("+33600000000"); MessagesManager.messagesStatus(msg);
#!/usr/bin/env ruby require 'json' require 'rest-client' apiKey = 'YOUR_API_KEY' number = '+33600000000' url = 'https://api.primotexto.com/v2/messages/status?identifier=' response = RestClient.get(url + number.gsub("+", "%2B"), { 'X-Primotexto-ApiKey' => apiKey } ) puts response
var apiKey = "YOUR_API_KEY"; var url = "https://api.primotexto.com/v2/messages/status?identifier="; var identifier = "+33600000000"; var Client = require('node-rest-client').Client; var client = new Client(); client.get(url + identifier.replace('+', '%2B'), { headers: { "X-Primotexto-ApiKey": apiKey, "Content-Type": "application/json" } }, function (data, response) { console.log(data); });
#!/usr/bin/env python import requests apiKey = 'YOUR_API_KEY' url = 'https://api.primotexto.com/v2/messages/status?identifier=' number = '+33600000000' response = requests.get(url + number.replace('+', '%2B'), headers={'X-Primotexto-ApiKey': apiKey}) print response.content
#!/usr/bin/perl use REST::Client; my $apiKey = 'YOUR_API_KEY'; my $url = 'https://api.primotexto.com/v2/messages/status?identifier='; my $identifier = '+33600000000'; my $client = REST::Client->new(); $identifier =~ s/\+/%2B/g; $client->GET($url.$identifier, { "X-Primotexto-ApiKey" => $apiKey}); print $client->responseContent()."\n";
myApiKey est une cha�ne = "YOUR_API_KEY" myUrl est une cha�ne = "https://api.primotexto.com/v2/messages/status?identifier=" myIdentifier est une cha�ne = "+33600000000" cMaRequete est un restRequête cMaRequete..Méthode = "GET" cMaRequete.Entête["X-Primotexto-ApiKey"] = myApiKey myNewIdentifier est une cha�ne = Remplace(myIdentifier,"+","%2B") cMaRequete..URL = myUrl + myNewIdentifier cMaReponse est un restRéponse = RESTEnvoie(cMaRequete) SI ErreurDétectée ALORS Erreur(ErreurInfo(errComplet)) SINON Info(cMaReponse..Contenu) FIN


Statut d'un message par snapshotId (362891)

Requête à envoyer

URL

https://api.primotexto.com/v2/messages/status?snapshotId=362891

HTTP METHOD

GET

HEADERS

X-Primotexto-ApiKey: YOUR_API_KEY Content-Type: application/json

Retour de l'API


HEADERS

HTTP/1.1 200 OK Date: Fri, 08 Jan 2016 15:11:02 GMT Server: Apache Content-Type: application/json;charset=UTF-8 Vary: Accept-Encoding Transfer-Encoding: chunked

DATA

{ "delivered": 1387808142057, "id": 362891, "sent": 1387808111339, "state": "delivered", "stateDate": 1387808142057, "submitted": 1387808111833, "test": false }
State
Description
sent
Message envoyé (acquittement opérateur)
submitted
Message envoyé (sans aquittement opérateur)
delivered
Message re�u (accusé de récéption opérateur)
unsubscribed
Le destinataire du message s'est désinscrit (STOP SMS)
bounced
Le destinataire du message est un numéro non-attribué
opened
Le destinataire du message a ouvert un lien tracké
reply
Le destinataire du message a répondu
error
Le message n'est pas arrivé à destination
// Download library -> https://www.primotexto.com/api/librairies/latest-php.asp require_once 'primotexto-api-php/baseManager.class.php'; // Authentication authenticationManager::setApiKey('YOUR_API_KEY'); // Status by snapshotId $msg = new Query; $msg->type = 'notification'; $msg->snapshotId = '362891'; messagesManager::messagesStatus($msg);;
curl -X GET \ -H "X-Primotexto-ApiKey: YOUR_API_KEY" \ https://api.primotexto.com/v2/messages/status?snapshotId=12345678
// Download library -> JDK 1.5 : https://www.primotexto.com/api/librairies/latest-jdk-1.5.zip // Download library -> JDK 1.6 : https://www.primotexto.com/api/librairies/latest-jdk-1.6.zip // Download library -> JDK 1.7 : https://www.primotexto.com/api/librairies/latest-jdk-1.7.zip import com.primotexto.*; // Authentication AuthenticationManager.setApiKey("YOUR_API_KEY"); // Status by identifier PTMessageStatusResponse response = MessagesManager.messagesStatusByIdentifier("+33600000000"); System.out.println(response.toString()); System.out.println(BaseManager.getDate(response.getDelivered())); // Status by snapshotId PTMessageStatusResponse response = MessagesManager.messagesStatusBySnapshot("17976561"); System.out.println(response.toString()); System.out.println(BaseManager.getDate(response.getDelivered()));
// Download library -> .NET 4.0 : https://www.primotexto.com/api/librairies/latest-net-4.0.asp // Download library -> .NET 4.5 : https://www.primotexto.com/api/librairies/latest-net-4.5.asp using Primotexto; // Authentication AuthenticationManager.setApiKey("YOUR_API_KEY"); // Status by snapshotId PTQuery msg = new PTQuery(); msg.setType("notification"); msg.setSnapshotId("12345678"); MessagesManager.messagesStatus(msg);
#!/usr/bin/env ruby require 'json' require 'rest-client' apiKey = 'YOUR_API_KEY' snapshotId = '31724833' url = 'https://api.primotexto.com/v2/messages/status?snapshotId=' response = RestClient.get(url + snapshotId, { 'X-Primotexto-ApiKey' => apiKey } ) puts response
var apiKey = "YOUR_API_KEY"; var url = "https://api.primotexto.com/v2/messages/status?snapshotId="; var snapshotId = "31733183"; var Client = require('node-rest-client').Client; var client = new Client(); client.get(url + snapshotId, { headers: { "X-Primotexto-ApiKey": apiKey, "Content-Type": "application/json" } }, function (data, response) { console.log(data); });
#!/usr/bin/env python import requests apiKey = 'YOUR_API_KEY' url = 'https://api.primotexto.com/v2/messages/status?identifier=' snapshotId = '31732997' response = requests.get(url + snapshotId, headers={'X-Primotexto-ApiKey': apiKey}) print response.content
#!/usr/bin/perl use REST::Client; my $apiKey = 'YOUR_API_KEY'; my $url = 'https://api.primotexto.com/v2/messages/status?snapshotId='; my $snapshotId = '31733183'; my $client = REST::Client->new(); $client->GET($url.$snapshotId, { "X-Primotexto-ApiKey" => $apiKey}); print $client->responseContent()."\n";
myApiKey est une cha�ne = "YOUR_API_KEY" myUrl est une cha�ne = "https://api.primotexto.com/v2/messages/status?snapshotId=" mySnapshotId est une cha�ne = "31739425" cMaRequete est un restRequête cMaRequete..Méthode = "GET" cMaRequete.Entête["X-Primotexto-ApiKey"] = myApiKey cMaRequete..URL = myUrl + mySnapshotId cMaReponse est un restRéponse = RESTEnvoie(cMaRequete) SI ErreurDétectée ALORS Erreur(ErreurInfo(errComplet)) SINON Info(cMaReponse..Contenu) FIN