Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP client for the ClicRDV API using libcurl
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
README.md
clicrdv-rest-client.php
exemple.php

README.md

ClicRDV PHP Client

Librairie PHP permettant d'accéder à l'API ClicRDV.

  • Utilise l'API en JSON
  • nécessite libcurl

Utilisation

<?php

   $apikey = 'xxxxxxxxxxxxxxxxx';
   $username = 'moncompte@clicrdv.com';
   $password = 'secret';

   require('clicrdv-rest-client.php');
   $c = new ClicRDVclient($apikey, $username, $password);

   echo "Creation de la fiche John Doe...\n";
   $r = $c->post('/api/v1/fiches', array(
     'fiche' => array(
       'firstname'=> 'John',
       'lastname'=> 'Doe'
     )
   ));
   echo "Status code : ".$c->getStatusCode()."\n";
   echo "Fiche crée ! id = ".$r->id."\n";

   echo "Modification de la fiche...\n";
   $r = $c->put('/api/v1/fiches/'.$r->id, array(
     'fiche' => array(
       'firstphone' => '01 83 62 04 04'
     )
   ));
   echo "Status code : ".$c->getStatusCode()."\n";
   echo "Fiche modifiée !\n";

   echo "Récupération de la fiche...\n";
   $r = $c->get('/api/v1/fiches/'.$r->id);
   echo "Status code : ".$c->getStatusCode()."\n";
   print_r($r);

   echo "Suppression de la fiche John Doe...\n";
   $r = $c->delete('/api/v1/fiches/'.$r->id);
   echo "Status code : ".$c->getStatusCode()."\n";
   echo "Fiche supprimée !\n"

?>
Something went wrong with that request. Please try again.