Git Product home page Git Product logo

dendreo's Introduction

Dendreo

Gem pour l'API du CRM Dendreo.

Installation

Ajoutez cette ligne à votre Gemfile:

gem 'Dendreo'

Bien entendu:

$ bundle

Ou installez la gem vous-même:

$ gem install dendreo

Démarrage rapide

Instanciez votre API.

  dendreo = Dendreo::API.new('https://pro.dendreo.com/masociété/api', 'MaCleApi')

Attention à bien vérifier que votre url à bien ce format:

 'https://pro.dendreo.com/masociété/api'

Utilisation:

Je vous invite à bien lire la documentation de l'api ici => https://developers.dendreo.com/

La gem utilise la 'method_missing', il vous suffira donc de récupérer le nom de la resource que vous souhaitez récupérer, ajouter ou modifier.

Exemple:

Il faut donc piocher le nom de la ressource tel quel est dans l'url de la requête API.

  • Catégories de module. => 'categories_module'
  • Catégories de produits => 'categories_produit'
  • Modules/Produits => 'modules'
  • Formateurs => 'formateurs'
  • Entreprises => 'entreprises'
  • Contacts => 'contacts'
  • Particuliers => 'contacts' avec la variable 'particulier' = 1 sinon ajout d'un contact
  • Participants => 'participants'
  • Etapes => 'etapes'
  • Centres de formation => 'centres_de_formation'
  • Salles de formation => 'salles_de_formation'
  • Factures => 'factures'
  • Actions de formation => 'actions_de_formation'
  • Créneaux => 'creneaux'
  • Inscription d'un participant => 'laps'
  • Programmation d'un module => 'lams'
  • Mails => 'emails'

Arguments:

# methode http 
{ method: :get }

# toute information qui doit passer par l'url
{ url_data: { id: 123456 } } 

# toute information que vous souhaitez modifier/créer
{ form_data: { email: '[email protected]' } } 

# exemple d'utilisation
dendreo = Dendreo::API.new('https://pro.dendreo.com/masociété/api', 'MaCleApi') 

dendreo.participants(
  method: :post, 
  url_data: { 
    id_participant: 1345 
  }, 
  form_data: { 
    nom: 'nouveau nom', 
    civilite: 'M.', 
    id_add: 2, 
  }
) 

Pour les participants ( GET https://pro.dendreo.com/demo/api/participants.php?)

  # Renvoi tous les particpants
  dendreo.participants(method: 'get')

  # Renvoi le particpant qui a l'id en question
  dendreo.participants(method: 'get', url_data: { id_participant: 1345 })

  # Renvoi le ou les particpants qui ont l'email en question
  dendreo.participants(method: 'get', url_data: { email: '[email protected]' })

  #Renvoi le ou les particpants qui ont le commentaire en question
  dendreo.participants(method: 'get', url_data: { search: 'Un nom ou ce que vous souhaitez id, email, commentaires etc..' })

Ajouter ou modifier un participant.

Attention, pour modifier un participant déjà existant, il vous suffit de remplacer 'id_participant' par 'id' tout court et d'ajouter un 'id_add' qui contiendra un id d'administrateur.

Faites appel au support dendreo pour plus d'informations, ils sont très réactifs [email protected] .

  # Créer un participant
  dendreo.participants(method: 'post', form_data: { nom: 'nouveau nom', prenom: 'toto', civilite: 'M.', email: '[email protected]', id_add: 2 })

  # Modifier un participant existant (Attention, bien remplacer 'id' par 'id_participant' et ajouter un 'id_add' pour
  # s'identifier en admin sur la mise à jour.)
  dendreo.participants(method: 'post', url_data: { id_participant: 1345 }, form_data: { nom: 'nouveau nom', civilite: 'M.', id_add: 2 })

  # Supprimer un participant (attention, il n'y a pas de methode 'delete' sur tous les endpoints)
  dendreo.participants(method: 'delete', url_data: { id_participant: 1345 })

Contribution

Rapports de bugs et contibutions ici => https://github.com/RonanLOUARN/dendreo.

Licence

Cette gem est opensource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.