Référence API pour les développeurs v3

Commencer

Une clé API est requise pour que les demandes soient traitées par le système. Une fois qu'un utilisateur s'inscrit, une clé API est automatiquement générée pour cet utilisateur. La clé API doit être envoyée avec chaque requête (voir l'exemple complet ci-dessous). Si la clé API n'est pas envoyée ou a expiré, il y aura une erreur. Assurez-vous de garder votre clé API secrète pour éviter les abus.

Authentification

Pour vous authentifier auprès du système API, vous devez envoyer votre clé API sous forme de jeton d'autorisation à chaque demande. Vous pouvez voir un exemple de code ci-dessous.

curl --location --request POST 'https://www.e.vg/api/url/add' \ 
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \ 
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/url/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer YOURAPIKEY",
    "Content-Type: application/json",
    ),
));

$response = curl_exec($curl);
Limite de débit

Notre API dispose d'un limiteur de débit pour se protéger contre les pics de demandes afin de maximiser sa stabilité. Notre limiteur de débit est actuellement limité à 3000 requêtes par 1 minute.

Plusieurs en-têtes seront envoyés avec la réponse et ceux-ci peuvent être examinés pour déterminer diverses informations sur la demande.

X-RateLimit-Limit: 3000
X-RateLimit-Remaining: 2999
X-RateLimit-Reset: TIMESTAMP
Gestion des réponses

Toutes les réponses de l'API sont renvoyées au format JSON par défaut. Pour convertir cela en données utilisables, la fonction appropriée devra être utilisée en fonction de la langue. En PHP, la fonction json_decode() peut être utilisée pour convertir les données en objet (par défaut) ou en tableau (définissez le deuxième paramètre sur true). Il est très important de vérifier la clé d'erreur car elle indique s'il y a eu une erreur ou non. Vous pouvez également vérifier le code d'en-tête.

{
    "error": 1,
    "message": "An error ocurred"
}

Campagnes

Répertorier les campagnes
GET https://www.e.vg/api/campaigns?limit=2&page=1

Pour obtenir vos campagnes via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/campaigns?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/campaigns?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "campaigns": [
            {
                "id": 1,
                "name": "Sample Campaign",
                "public": false,
                "rotator": false,
                "list": "https:\/\/domain.com\/u\/admin\/list-1"
            },
            {
                "id": 2,
                "domain": "Facebook Campaign",
                "public": true,
                "rotator": "https:\/\/domain.com\/r\/test",
                "list": "https:\/\/domain.com\/u\/admin\/test-2"
            }
        ]
    }
}
Créer une campagne
POST https://www.e.vg/api/campaign/add

Une campagne peut être ajoutée à l'aide de ce point de terminaison.

Paramètre La description
name (facultatif) Nom de la campagne
slug (optionnel) Rotator Slug
public (facultatif) Accès
curl --location --request POST 'https://www.e.vg/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Campaign",
    "slug": "new-campaign",
    "public": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/campaign/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'New Campaign',
  'slug' => 'new-campaign',
  'public' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 3,
    "domain": "New Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/new-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/new-campaign-3"
}
Attribuer un lien à une campagne
POST https://www.e.vg/api/campaign/:campaignid/assign/:linkid

Un lien court peut être attribué à une campagne à l'aide de ce point de terminaison. Le point de terminaison nécessite l'ID de campagne et l'ID de lien court.

curl --location --request POST 'https://www.e.vg/api/campaign/:campaignid/assign/:linkid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/campaign/:campaignid/assign/:linkid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Link successfully added to the campaign."
}
Mettre à jour la campagne
PUT https://www.e.vg/api/campaign/:id/update

Pour mettre à jour une campagne, vous devez envoyer une donnée valide au format JSON via une requête PUT. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
name (obligatoire) Nom de la campagne
slug (optionnel) Rotator Slug
public (facultatif) Accès
curl --location --request PUT 'https://www.e.vg/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Twitter Campaign",
    "slug": "twitter-campaign",
    "public": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/campaign/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'Twitter Campaign',
  'slug' => 'twitter-campaign',
  'public' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 3,
    "domain": "Twitter Campaign",
    "public": true,
    "rotator": "https:\/\/domain.com\/r\/twitter-campaign",
    "list": "https:\/\/domain.com\/u\/admin\/twitter-campaign-3"
}
Supprimer la campagne
DELETE https://www.e.vg/api/campaign/:id/delete

Pour supprimer une campagne, vous devez envoyer une requête DELETE.

curl --location --request DELETE 'https://www.e.vg/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/campaign/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Campaign has been deleted successfully."
}

Canaux

Liste des chaînes
GET https://www.e.vg/api/channels?limit=2&page=1

Pour obtenir vos canaux via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/channels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channels?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "channels": [
            {
                "id": 1,
                "name": "Channel 1",
                "description": "Description of channel 1",
                "color": "#000000",
                "starred": true
            },
            {
                "id": 2,
                "name": "Channel 2",
                "description": "Description of channel 2",
                "color": "#FF0000",
                "starred": false
            }
        ]
    }
}
Liste des éléments de la chaîne
GET https://www.e.vg/api/channel/:id?limit=1&page=1

Pour obtenir des éléments dans certains canaux via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/channel/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channel/:id?limit=1&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "items": [
            {
                "type": "links",
                "id": 1,
                "title": "My Sample Link",
                "preview": "https:\/\/google.com",
                "link": "https:\/\/www.e.vg\/google",
                "date": "2022-05-12"
            },
            {
                "type": "bio",
                "id": 1,
                "title": "My Sample Bio",
                "preview": "https:\/\/www.e.vg\/mybio",
                "link": "https:\/\/www.e.vg\/mybio",
                "date": "2022-06-01"
            }
        ]
    }
}
Créer une chaîne
POST https://www.e.vg/api/channel/add

Un canal peut être ajouté à l'aide de ce point de terminaison.

Paramètre La description
name (obligatoire) Nom de la chaîne
description (facultatif) Description de la chaîne
color (facultatif) Couleur du badge de la chaîne (HEX)
starred (facultatif) Star le canal ou non (vrai ou faux)
curl --location --request POST 'https://www.e.vg/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channel/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'New Channel',
  'description' => 'my new channel',
  'color' => '#000000',
  'starred' => true,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 3,
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}
Attribuer un article à un canal
POST https://www.e.vg/api/channel/:channelid/assign/:type/:itemid

Un élément peut être attribué à n'importe quel canal en envoyant une demande avec l'identifiant du canal, le type d'élément (liens, bio ou qr) et l'identifiant de l'élément.

Paramètre La description
:channelid (obligatoire) ID de canal
:type (obligatoire) liens ou bio ou qr
:itemid (obligatoire) ID de l'article
curl --location --request POST 'https://www.e.vg/api/channel/:channelid/assign/:type/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channel/:channelid/assign/:type/:itemid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Item successfully added to the channel."
}
Mettre à jour la chaîne
PUT https://www.e.vg/api/channel/:id/update

Pour mettre à jour un canal, vous devez envoyer une donnée valide au format JSON via une requête PUT. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
name (facultatif) Nom de la chaîne
description (facultatif) Description de la chaîne
color (facultatif) Couleur du badge de la chaîne (HEX)
starred (facultatif) Star le canal ou non (vrai ou faux)
curl --location --request PUT 'https://www.e.vg/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Acme Corp",
    "description": "channel for items for Acme Corp",
    "color": "#FFFFFF",
    "starred": false
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channel/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'Acme Corp',
  'description' => 'channel for items for Acme Corp',
  'color' => '#FFFFFF',
  'starred' => false,
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Channel has been updated successfully."
}
Supprimer la chaîne
DELETE https://www.e.vg/api/channel/:id/delete

Pour supprimer une chaîne, vous devez envoyer une requête DELETE. Tous les éléments seront également non attribués.

curl --location --request DELETE 'https://www.e.vg/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/channel/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Channel has been deleted successfully."
}

Codes QR

Liste des codes QR
GET https://www.e.vg/api/qr?limit=2&page=1

Pour obtenir vos codes QR via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/qr?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "qrs": [
            {
                "id": 2,
                "link": "https:\/\/www.e.vg\/qr\/a2d5e",
                "scans": 0,
                "name": "Google",
                "date": "2020-11-10 18:01:43"
            },
            {
                "id": 1,
                "link": "https:\/\/www.e.vg\/qr\/b9edfe",
                "scans": 5,
                "name": "Google Canada",
                "date": "2020-11-10 18:00:25"
            }
        ]
    }
}
Obtenez un seul code QR
GET https://www.e.vg/api/qr/:id

Pour obtenir les détails d'un seul code QR via l'API, vous pouvez utiliser ce point de terminaison.

curl --location --request GET 'https://www.e.vg/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/qr/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "details": {
        "id": 1,
        "link": "https:\/\/www.e.vg\/qr\/b9edfe",
        "scans": 5,
        "name": "Google Canada",
        "date": "2020-11-10 18:00:25"
    },
    "data": {
        "clicks": 1,
        "uniqueClicks": 1,
        "topCountries": {
            "Unknown": "1"
        },
        "topReferrers": {
            "Direct, email and other": "1"
        },
        "topBrowsers": {
            "Chrome": "1"
        },
        "topOs": {
            "Windows 10": "1"
        },
        "socialCount": {
            "facebook": 0,
            "twitter": 0,
            "instagram": 0
        }
    }
}
Créer un code QR
POST https://www.e.vg/api/qr/add

Pour créer un QR Code, vous devez envoyer une donnée valide en JSON via une requête POST. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
type texte (obligatoire) | vcard | lien | e-mail | téléphone | sms | Wifi
data (obligatoire) Données à intégrer dans le code QR. Les données peuvent être des chaînes ou des tableaux selon le type
background (optionnel) Couleur RVB par ex. RVB(255,255,255)
foreground (optionnel) Couleur RVB par ex. RVB(0,0,0)
logo (facultatif) Chemin vers le logo en png ou jpg
curl --location --request POST 'https://www.e.vg/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/qr/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'link',
  'data' => 'https://google.com',
  'background' => 'rgb(255,255,255)',
  'foreground' => 'rgb(0,0,0)',
  'logo' => 'https://site.com/logo.png',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 3,
    "link": "https:\/\/www.e.vg\/qr\/a58f79"
}
Mettre à jour le code QR
PUT https://www.e.vg/api/qr/:id/update

Pour mettre à jour un QR Code, vous devez envoyer une donnée valide au format JSON via une requête PUT. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
data (obligatoire) Données à intégrer dans le code QR. Les données peuvent être des chaînes ou des tableaux selon le type
background (optionnel) Couleur RVB par ex. RVB(255,255,255)
foreground (optionnel) Couleur RVB par ex. RVB(0,0,0)
logo (facultatif) Chemin vers le logo en png ou jpg
curl --location --request PUT 'https://www.e.vg/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "link",
    "data": "https:\/\/google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https:\/\/site.com\/logo.png"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/qr/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'link',
  'data' => 'https://google.com',
  'background' => 'rgb(255,255,255)',
  'foreground' => 'rgb(0,0,0)',
  'logo' => 'https://site.com/logo.png',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "QR has been updated successfully."
}
Supprimer un code QR
DELETE https://www.e.vg/api/qr/:id/delete

Pour supprimer un code QR, vous devez envoyer une demande DELETE.

curl --location --request DELETE 'https://www.e.vg/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/qr/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "QR Code has been deleted successfully."
}

Compte

Obtenir un compte
GET https://www.e.vg/api/account

Pour obtenir des informations sur le compte, vous pouvez envoyer une demande à ce point de terminaison et il renverra des données sur le compte.

curl --location --request GET 'https://www.e.vg/api/account' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/account",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "data": {
        "id": 1,
        "email": "[email protected]",
        "username": "sampleuser",
        "avatar": "https:\/\/domain.com\/content\/avatar.png",
        "status": "pro",
        "expires": "2022-11-15 15:00:00",
        "registered": "2020-11-10 18:01:43"
    }
}
Compte mis à jour
PUT https://www.e.vg/api/account/update

Pour mettre à jour les informations sur le compte, vous pouvez envoyer une demande à ce point de terminaison et il mettra à jour les données sur le compte.

curl --location --request PUT 'https://www.e.vg/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "newpassword"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/account/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'email' => '[email protected]',
  'password' => 'newpassword',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Account has been successfully updated."
}

Domaines de marque

Répertorier les domaines de marque
GET https://www.e.vg/api/domains?limit=2&page=1

Pour obtenir vos domaines de marque via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/domains?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "domains": [
            {
                "id": 1,
                "domain": "https:\/\/domain1.com",
                "redirectroot": "https:\/\/rootdomain.com",
                "redirect404": "https:\/\/rootdomain.com\/404"
            },
            {
                "id": 2,
                "domain": "https:\/\/domain2.com",
                "redirectroot": "https:\/\/rootdomain2.com",
                "redirect404": "https:\/\/rootdomain2.com\/404"
            }
        ]
    }
}
Créer un domaine de marque
POST https://www.e.vg/api/domain/add

Un domaine peut être ajouté à l'aide de ce point de terminaison. Veuillez vous assurer que le domaine pointe correctement vers notre serveur.

Paramètre La description
domain (obligatoire) Domaine de marque incluant http ou https
redirectroot (facultatif) Redirection racine lorsque quelqu'un visite votre domaine
redirect404 (facultatif) Redirection 404 personnalisée
curl --location --request POST 'https://www.e.vg/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "domain": "https:\/\/domain1.com",
    "redirectroot": "https:\/\/rootdomain.com",
    "redirect404": "https:\/\/rootdomain.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/domain/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'domain' => 'https://domain1.com',
  'redirectroot' => 'https://rootdomain.com',
  'redirect404' => 'https://rootdomain.com/404',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 1
}
Mettre à jour le domaine
PUT https://www.e.vg/api/domain/:id/update

Pour mettre à jour un domaine de marque, vous devez envoyer des données valides au format JSON via une requête PUT. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
redirectroot (facultatif) Redirection racine lorsque quelqu'un visite votre domaine
redirect404 (facultatif) Redirection 404 personnalisée
curl --location --request PUT 'https://www.e.vg/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "redirectroot": "https:\/\/rootdomain-new.com",
    "redirect404": "https:\/\/rootdomain-new.com\/404"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/domain/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'redirectroot' => 'https://rootdomain-new.com',
  'redirect404' => 'https://rootdomain-new.com/404',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Domain has been updated successfully."
}
Supprimer le domaine
DELETE https://www.e.vg/api/domain/:id/delete

Pour supprimer un domaine, vous devez envoyer une requête DELETE.

curl --location --request DELETE 'https://www.e.vg/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/domain/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Domain has been deleted successfully."
}

Liens


Splash personnalisé

Liste des éclaboussures personnalisées
GET https://www.e.vg/api/splash?limit=2&page=1

Pour obtenir des pages de démarrage personnalisées via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/splash?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "splash": [
            {
                "id": 1,
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "name": "Product 2 Promo",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

pixels

Lister les pixels
GET https://www.e.vg/api/pixels?limit=2&page=1

Pour obtenir vos codes de pixels via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/pixels?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "pixels": [
            {
                "id": 1,
                "type": "gtmpixel",
                "name": "GTM Pixel",
                "tag": "GA-123456789",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "twitterpixel",
                "name": "Twitter Pixel",
                "tag": "1234567",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}
Créer un pixel
POST https://www.e.vg/api/pixel/add

Un pixel peut être créé à l'aide de ce point de terminaison. Vous devez envoyer le type de pixel et la balise.

Paramètre La description
type (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok
name (obligatoire) Nom personnalisé pour votre pixel
tag (obligatoire) La balise du pixel
curl --location --request POST 'https://www.e.vg/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/pixel/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'gtmpixel',
  'name' => 'My GTM',
  'tag' => 'GTM-ABCDE',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "id": 1
}
Mettre à jour le pixel
PUT https://www.e.vg/api/pixel/:id/update

Pour mettre à jour un pixel, vous devez envoyer une donnée valide en JSON via une requête PUT. Les données doivent être envoyées en tant que corps brut de votre demande, comme indiqué ci-dessous. L'exemple ci-dessous montre tous les paramètres que vous pouvez envoyer mais vous n'êtes pas obligé de tous les envoyer (voir le tableau pour plus d'informations).

Paramètre La description
name (facultatif) Nom personnalisé pour votre pixel
tag (obligatoire) La balise du pixel
curl --location --request PUT 'https://www.e.vg/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/pixel/:id/update",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'name' => 'My GTM',
  'tag' => 'GTM-ABCDE',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Pixel has been updated successfully."
}
Supprimer le pixel
DELETE https://www.e.vg/api/pixel/:id/delete

Pour supprimer un pixel, vous devez envoyer une requête DELETE.

curl --location --request DELETE 'https://www.e.vg/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/pixel/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "Pixel has been deleted successfully."
}

Superpositions CTA

Répertorier les superpositions CTA
GET https://www.e.vg/api/overlay?limit=2&page=1

Pour obtenir des superpositions CTA via l'API, vous pouvez utiliser ce point de terminaison. Vous pouvez également filtrer les données (voir le tableau pour plus d'informations).

Paramètre La description
limit (facultatif) Résultat de données par page
page (optionnel) Demande de page courante
curl --location --request GET 'https://www.e.vg/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/overlay?limit=2&page=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "cta": [
            {
                "id": 1,
                "type": "message",
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "contact",
                "name": "Contact Page",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

Utilisateurs

Ce point de terminaison n'est accessible qu'aux utilisateurs disposant de privilèges d'administrateur.

Répertorier les utilisateurs
GET https://www.e.vg/api/users?filter=free

Obtenez une liste de tous les utilisateurs de la plateforme. Les données peuvent être filtrées en envoyant un paramètre de filtre dans l'url.

Paramètre La description
filter administrateur | gratuit | pro
email Rechercher un utilisateur par e-mail
curl --location --request GET 'https://www.e.vg/api/users?filter=free' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/users?filter=free",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "data": [
        {
            "id": 2,
            "email": "[email protected]",
            "username": "sample2user",
            "avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
            "status": "free",
            "planid": 1,
            "expires": null,
            "registered": "2020-11-10 18:01:43",
            "apikey": "ABC123DEF456"
        },
        {
            "id": 1,
            "email": "[email protected]",
            "username": "sampleuser",
            "avatar": "https:\\\/\\\/domain.com\/content\/avatar.png",
            "status": "pro",
            "planid": 2,
            "expires": "2022-11-15 15:00:00",
            "registered": "2020-11-10 18:01:43",
            "apikey": "ABC123DEF456"
        }
    ]
}
Lister un seul utilisateur
GET https://www.e.vg/api/user/:id

Obtenez des données pour un seul utilisateur.

curl --location --request GET 'https://www.e.vg/api/user/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/user/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "data": {
        "id": 2,
        "email": "[email protected]",
        "username": "sample2user",
        "avatar": "https:\\\/\\\/domain.com\/content\/avatar2.png",
        "status": "free",
        "planid": 1,
        "expires": null,
        "registered": "2020-11-10 18:01:43",
        "apikey": "ABC123DEF456"
    }
}
Créer un utilisateur
POST https://www.e.vg/api/user/add

Pour créer un utilisateur, utilisez ce point de terminaison et envoyez les informations suivantes au format JSON.

Paramètre La description
username (obligatoire) Nom d'utilisateur de l'utilisateur. Doit être valide.
email (obligatoire) Courriel de l'utilisateur. Doit être valide.
password (obligatoire) Mot de passe de l'utilisateur. Minimum 5 caractères.
planid (facultatif) Forfait Premium. Cela peut être trouvé dans le panneau d'administration.
expiration (facultatif) Exemple d'expiration d'adhésion 2020-12-26 12:00:00
curl --location --request POST 'https://www.e.vg/api/user/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "user",
    "password": "1234567891011",
    "email": "[email protected]",
    "planid": 1,
    "expiration": "2020-11-20 11:00:00"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/user/add",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'username' => 'user',
  'password' => '1234567891011',
  'email' => '[email protected]',
  'planid' => 1,
  'expiration' => '2020-11-20 11:00:00',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "User has been registered.",
    "data": {
        "id": 3,
        "email": "[email protected]",
        "username": "user"
    }
}
Supprimer l'utilisateur
DELETE https://www.e.vg/api/user/:id/delete

Pour supprimer un utilisateur, utilisez ce point de terminaison.

curl --location --request DELETE 'https://www.e.vg/api/user/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/user/:id/delete",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "DELETE",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "User has been deleted."
}
Utilisateur de connexion
GET https://www.e.vg/api/user/login/:id

Ce point de terminaison générera un lien unique qui permettra à l'utilisateur de se connecter automatiquement à la plateforme. Les urls de connexion SSO sont valables 1 heure et utilisables une seule fois.

curl --location --request GET 'https://www.e.vg/api/user/login/:id' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/user/login/:id",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "url": "https:\/\/www.e.vg\/user\/login\/sso\/fdfioarounrgswkxamsuebruhlawynti"
}

Des plans

Ce point de terminaison n'est accessible qu'aux utilisateurs disposant de privilèges d'administrateur.

Plans de liste
GET https://www.e.vg/api/plans

Obtenez une liste de tous les plans sur la plateforme.

curl --location --request GET 'https://www.e.vg/api/plans' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/plans",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "data": [
        {
            "id": 2,
            "name": "Business",
            "free": false,
            "prices": {
                "monthly": 9.99,
                "yearly": 99.99,
                "lifetime": 999.99
            },
            "limits": {
                "links": 100,
                "clicks": 100000,
                "retention": 60,
                "custom": {
                    "enabled": "0"
                },
                "team": {
                    "enabled": "0",
                    "count": "0"
                },
                "splash": {
                    "enabled": "1",
                    "count": "5"
                },
                "overlay": {
                    "enabled": "1",
                    "count": "10"
                },
                "pixels": {
                    "enabled": "1",
                    "count": "10"
                },
                "domain": {
                    "enabled": "1",
                    "count": "1"
                },
                "multiple": {
                    "enabled": "0"
                },
                "alias": {
                    "enabled": "1"
                },
                "device": {
                    "enabled": "0"
                },
                "geo": {
                    "enabled": "0"
                },
                "bundle": {
                    "enabled": "0"
                },
                "parameters": {
                    "enabled": "0"
                },
                "export": {
                    "enabled": "0"
                },
                "api": {
                    "enabled": "0"
                }
            }
        },
        {
            "id": 1,
            "name": "Starter",
            "free": true,
            "prices": null,
            "limits": {
                "links": 10,
                "clicks": 1000,
                "retention": 7,
                "custom": {
                    "enabled": "0"
                },
                "team": {
                    "enabled": "0",
                    "count": "0"
                },
                "splash": {
                    "enabled": "0",
                    "count": "0"
                },
                "overlay": {
                    "enabled": "0",
                    "count": "10"
                },
                "pixels": {
                    "enabled": "0",
                    "count": "10"
                },
                "domain": {
                    "enabled": "0",
                    "count": "0"
                },
                "multiple": {
                    "enabled": "0"
                },
                "alias": {
                    "enabled": "0"
                },
                "device": {
                    "enabled": "0"
                },
                "geo": {
                    "enabled": "0"
                },
                "bundle": {
                    "enabled": "0"
                },
                "parameters": {
                    "enabled": "0"
                },
                "export": {
                    "enabled": "0"
                },
                "api": {
                    "enabled": "0"
                }
            }
        }
    ]
}
Abonnez un utilisateur à un forfait
PUT https://www.e.vg/api/plan/:planid/user/:userid

Pour abonner un utilisateur au forfait, envoyez une demande PUT à ce point de terminaison avec l'ID du forfait et l'ID utilisateur. Le type d'abonnement et la date d'expiration devront être précisés. Si la date d'expiration n'est pas spécifiée, la date sera ajustée en fonction du type.

Paramètre La description
type mensuel | annuel | durée de vie
expiration (facultatif) Date d'expiration du plan, par ex.2024-04-29 04:39:32
curl --location --request PUT 'https://www.e.vg/api/plan/:planid/user/:userid' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "monthly",
    "expiration": "2024-04-29 04:39:32"
}'
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://www.e.vg/api/plan/:planid/user/:userid",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 2,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => array(
        "Authorization: Bearer YOURAPIKEY",
        "Content-Type: application/json",
    ),
    CURLOPT_POSTFIELDS => json_encode(array (
  'type' => 'monthly',
  'expiration' => '2024-04-29 04:39:32',
)),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Réponse du serveur
{
    "error": 0,
    "message": "User has been subscribed to this plan."
}