1. Accueil
  2. API
  3. Add Reward

Add Reward

/addreward

This function allows to add new rewards.

  • Endpoint: https://app.fideljet.com/rest/addreward
  • Type: Post

 

apikeyAPI KEYYou can get it from your profil
https://app.Fideljet.com/profil then apikey section
nameReward nameReward name
pointsReward pointsthe number of points needed to get the reward

 

Here is a PHP exemple:

<?php 
$curl = curl_init(); $apikey = "YOUR_API_KEY"; 
$name = "Reward Name"; // Reward name 
$points= "100"; // the number of points needed to get the reward
curl_setopt_array($curl, array( CURLOPT_URL => "https://app.fideljet.com/rest/addreward",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \"apikey\":\"$apikey\",\"name\":\"$name\",\"points\":\"$points\"}",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"content-type: application/json"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

?>

Résultat:

{
  "message":"Success",
  "success":true,
  "data":{
    "reward_id":"434"
   }
}

 

Cet article vous a-t-il été utile ? Oui Non