Accueil Docs Tarifs À propos Admin

Documentation API

SoftAfrik Push API – Plateforme multi‑tenant de notifications push pour vos apps mobiles, web et backends.

API Overview

SoftAfrik Push API expose des endpoints REST pour enregistrer les utilisateurs, les devices et envoyer des notifications.

Authentication

Chaque requête doit inclure l’en‑tête X-API-KEY associé à votre client. Vous pouvez générer cette clé dans l’interface d’administration SoftAfrik Push API.

X-API-KEY: {YOUR_API_KEY}
Content-Type: application/json
                

POST /api/users/register

Crée ou retourne un PUID unique pour un utilisateur de votre système (external_user_ref).

Body JSON
{
  "external_user_ref": "user_12345",
  "meta": {
    "full_name": "John Doe",
    "email": "john@example.com"
  }
}
                

POST /api/devices/register

Associe un device (Android / iOS / Web) à un PUID pour recevoir les notifications.

Body JSON
{
  "puid": "sa_1001_xxxxxxxx",
  "app_name": "MyFintechApp",
  "platform": "android",
  "device_token": "AAAAxxxxxx",
  "device_uid": "device-uuid-123",
  "lang": "fr",
  "country": "TG"
}
                

POST /api/devices/unregister

Permet de désinscrire un device (par exemple lors d'une déconnexion).

{
  "device_token": "AAAAxxxxxx"
}
                

POST /api/push/to-user

Envoie une notification à tous les devices actifs liés à un PUID.

{
  "puid": "sa_1001_xxxxxxxx",
  "title": "Transfert reçu",
  "body": "Vous avez reçu 20 000 XOF",
  "data": {
    "transaction_id": 9932
  }
}
                

POST /api/push/to-device

Envoie une notification push à un device précis via son token.

{
  "device_token": "AAAAxxxxxx",
  "title": "Ping",
  "body": "Hello from SoftAfrik Push API"
}
                

POST /api/push/broadcast

Envoie une notification broadcast à tous les devices d’un client (ou filtrés par app / pays).

{
  "app_name": "MyFintechApp",
  "country": "TG",
  "title": "Maintenance",
  "body": "Our service will be unavailable tonight from 00:00 to 02:00."
}
                

GET /api/push/inbox

Récupère toutes les notifications enregistrées pour un PUID. Fonctionne même si l’utilisateur n’a jamais reçu les notifications (hors-ligne, téléphone éteint, notifications désactivées).

Query params
    /api/push/inbox?puid=sa_1001_xxxxxxxx
    
Réponse JSON
    [
      {
        "id": 15,
        "title": "Transfert reçu",
        "body": "Vous avez reçu 20 000 XOF",
        "data": { "transaction_id": 9932 },
        "is_read": false,
        "created_at": "2025-11-29 21:35:00"
      }
    ]
    

POST /api/push/read

Marque une notification comme lue. L’application partenaire peut appeler cet endpoint lorsqu’un utilisateur ouvre un message.

Body JSON
{
  "id": 15
}
Réponse JSON
{
  "success": true
}

POST /api/push/read-all

Marque toutes les notifications d’un PUID comme lues. Très utile pour effacer les badges (ex : 12 notifications non lues → 0).

Body JSON
{
  "puid": "sa_1001_xxxxxxxx"
}
Réponse JSON
{
  "success": true
}

SDK & Exemples par langage

Vous pouvez intégrer SoftAfrik Push API dans vos applications en utilisant n’importe quel langage supportant HTTP. Ci‑dessous quelques exemples de base.

SDK disponibles

Bundle complet SDK

Vous pouvez aussi télécharger tous les SDK en une seule archive ZIP.

Télécharger le bundle SDK (v1.0.0)

Exemple d'appel
curl -X POST https://softafrik-push-api.brillanciel.com/api/push/to-user \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "puid": "sa_1001_xxxxxxxx",
    "title": "Transfert reçu",
    "body": "Vous avez reçu 20 000 XOF",
    "data": { "transaction_id": 9932 }
  }'
                    
{
  "puid": "sa_1001_xxxxxxxx",
  "title": "Transfert reçu",
  "body": "Vous avez reçu 20 000 XOF",
  "data": { "transaction_id": 9932 }
}
$ch = curl_init("https://softafrik-push-api.brillanciel.com/api/push/to-user"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ "X-API-KEY: {YOUR_API_KEY}", "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode($payload), ]); $response = curl_exec($ch); curl_close($ch);
import fetch from "node-fetch";

const payload = {
  puid: "sa_1001_xxxxxxxx",
  title: "Transfert reçu",
  body: "Vous avez reçu 20 000 XOF",
  data: { transaction_id: 9932 },
};

const res = await fetch("https://softafrik-push-api.brillanciel.com/api/push/to-user", {
  method: "POST",
  headers: {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

const json = await res.json();
console.log(json);
                    
import requests

payload = {
    "puid": "sa_1001_xxxxxxxx",
    "title": "Transfert reçu",
    "body": "Vous avez reçu 20 000 XOF",
    "data": {"transaction_id": 9932},
}

resp = requests.post(
    "https://softafrik-push-api.brillanciel.com/api/push/to-user",
    headers={
        "X-API-KEY": "{YOUR_API_KEY}",
        "Content-Type": "application/json",
    },
    json=payload,
)

print(resp.status_code, resp.text)