API SMS

Intégrez Primotexto à vos applications grâce à notre puissante API SMS.

  >  
SMS  >  

Statistiques des SMS (par catégorie)

Requête

URL

https://api.primotexto.com/v2/messages/stats?category=codeConfirmation

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

{ "sent":925, "submitted":925, "delivered":872, "openers":114, "clickers":178, "clicks":145, "opens":241, "replies":62, "unsubscribers":3, "errors":31, "bounced":28, "complaint":3, "timespent":18 }
// 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'); // Stats $msg = new Query; $msg->type = 'notification' ; $msg->category = 'codeConfirmation'; messagesManager::messagesStats($msg);
curl -X GET \ -H "X-Primotexto-ApiKey: YOUR_API_KEY" \ https://api.primotexto.com/v2/messages/stats?category=codeConfirmation
// 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"); // Stats PTQuery msg = new PTQuery(); msg.setType("notification"); msg.setCategory("codeConfirmation"); MessagesManager.messagesStats(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"); // Stats PTMessageStatsResponse response = MessagesManager.messagesStats("codeConfirmation"); System.out.println(response.toString());
#!/usr/bin/env ruby require 'json' require 'rest-client' apiKey = 'YOUR_API_KEY' category = 'default' url = 'https://api.primotexto.com/v2/messages/stats?category=' + category response = RestClient.get(url, { 'X-Primotexto-ApiKey' => apiKey } ) puts response
var apiKey = "YOUR_API_KEY"; var url = "https://api.primotexto.com/v2/messages/stats?category="; var category = "default"; var Client = require('node-rest-client').Client; var client = new Client(); client.get(url + category, { 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/stats?category=' category = 'default' response = requests.get(url + category, headers={'X-Primotexto-ApiKey': apiKey, 'Content-Type':'application/json'}) print response.content
#!/usr/bin/perl use REST::Client; my $apiKey = 'YOUR_API_KEY'; my $url = 'https://api.primotexto.com/v2/messages/stats?category='; my $category = 'default'; my $client = REST::Client->new(); $client->GET($url.$category, { "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/stats?category=" myCategory est une chaîne = "default" cMaRequete est un restRequête cMaRequete..URL = myUrl cMaRequete..Méthode = "GET" cMaRequete.Entête["X-Primotexto-ApiKey"] = myApiKey cMaReponse est un restRéponse = RESTEnvoie(cMaRequete) SI ErreurDétectée ALORS Erreur(ErreurInfo(errComplet)) SINON Info(cMaReponse..Contenu) FIN