API SMS

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

  >  
SMS  >  

Réponses aux SMS pour une catégorie

Requête à envoyer

URL

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

HTTP METHOD

GET

HEADERS

X-Primotexto-ApiKey: YOUR_API_KEY

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

[ { "id":"54ede17ce4c0b0a16c1b2d46", "identifier":"+33600000000", "message":"Réponse 1" } { "id":"54ede17ce4c0b0a16c1b2d47", "identifier":"+33600000001", "message":"Réponse 2" } { "id":"54ede17ce4c0b0a16c1b2d48", "identifier":"+33600000002", "message":"Réponse 3" } ]
// 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'); // Callbacks $msg = new Query; $msg->type = 'notification'; $msg->category = 'codeConfirmation'; messagesManager::messagesCallbacks($msg);
curl -X GET \ -H "X-Primotexto-ApiKey: YOUR_API_KEY" \ https://api.primotexto.com/v2/messages/replies?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"); // Callbacks List response = MessagesManager.messagesCallbacks("codeConfirmation"); System.out.println(response.toString());
// 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"); PTQuery msg = new PTQuery(); msg.setType("notification"); msg.setCategory("tests"); MessagesManager.messagesCallbacks(msg);
#!/usr/bin/env ruby require 'json' require 'rest-client' apiKey = 'YOUR_API_KEY' category = 'default' url = 'https://api.primotexto.com/v2/messages/replies?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/replies?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/replies?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/replies?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/replies?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