GC Notification est basé sur le système de notification du gouvernement britannique. Par conséquent, l’API est également disponible en utilisant les clients développés par GOV.UK (disponible en anglais seulement).
Avant d’intégrer l’API
Vous devrez modifier votre point de terminaison :
Java
import uk.gov.service.notify.NotificationClient;
NotificationClient client = new NotificationClient(apiKey, "https://api.notification.canada
.NET
using Notify.Client;
var client = new NotificationClient(apiKey, "https://api.notification.canada.ca");
NodeJS
NotifyClient("https://api.notification.canada.ca", apiKey)
PHP
require __DIR__ . '/vendor/autoload.php';
$notifyClient = new \Alphagov\Notifications\Client([
'baseUrl' => "https://api.notification.canada.ca",
'apiKey' => 'your-api-key',
'httpClient' => new \Http\Adapter\Guzzle6\Client
]);
Python
from notifications_python_client.notifications import NotificationsAPIClient
notifications_client = NotificationsAPIClient(
api_key,
base_url="https://api.notification.canada.ca"
)
Ruby
require 'notifications/client'
client = Notifications::Client.new(api_key, "https://api.notification.canada.ca")
Différences de fonctionnalités à considérer<br>
L’envoi de fichiers par courriel est différent avec GC Notification
L’envoi de lettres n’est pas disponible
La réception de messages texte n’est pas disponible
Clients de GOV.UK
- Java (opens new window)(disponible en anglais seulement)
- .NET (opens new window)(disponible en anglais seulement)
- NodeJS (opens new window)(disponible en anglais seulement)
- PHP (opens new window)(disponible en anglais seulement)
- Python (opens new window)(disponible en anglais seulement)
- Ruby (opens new window)(disponible en anglais seulement)