Difference between revisions of "Module Zapier"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
Tag: 2017 source edit
 
(42 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- BEGIN origin interlang links -->
+
<!-- BEGIN interlang links -->
<!-- You can edit this section but do NOT remove these comments
+
<!-- Do NOT edit this section
     Links below will be automatically replicated on translated pages by PolyglotBot -->
+
     Links below are automatically managed by PolyglotBot
 +
    You can edit links on the English source page : Modul_Zapier -->
 
[[es:Módulo_Zapier]]
 
[[es:Módulo_Zapier]]
 
[[fr:Module_Zapier_FR]]
 
[[fr:Module_Zapier_FR]]
Line 8: Line 9:
  
 
[[Category:Zapier]]
 
[[Category:Zapier]]
 +
[[Category:No Code Automation]]
 
{{TemplateDocUser}}
 
{{TemplateDocUser}}
 
{{TemplateModEN}}
 
{{TemplateModEN}}
 
{{BasculeDevUser|
 
{{BasculeDevUser|
 
nom=Zapier|
 
nom=Zapier|
num=|
+
num=50330|
 
devdoc=[[Module Zapier (developer)]]|
 
devdoc=[[Module Zapier (developer)]]|
 
userdoc=This page|}}
 
userdoc=This page|}}
  
= Introduction =
+
=Introduction=
 
This module is to manage links between Dolibarr and Zapier.
 
This module is to manage links between Dolibarr and Zapier.
  
= Installation =
+
Some information and code examples are also available on [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier this page].
 +
 
 +
=Installation=
 
{{NoInstallModuleEn}}
 
{{NoInstallModuleEn}}
  
= Configuration =
+
=Configuration=
 
{{ActivationModuleEn}}
 
{{ActivationModuleEn}}
  
  
== Create a Zapier developper account ==
+
==Create a Zapier developper account==
  
At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/)
+
At first, you need to have a Zapier developper account, create it here: [https://developer.zapier.com Zapier Platform]
  
== Compile and Deploy the "Zapier App" on Zapier platform ==
+
==Build and Deploy the "Zapier App" on Zapier platform==
  
 
The Zapier App is a small package in javascript you have to deploy on Zapier so Zapier will be able to speak the language of your Dolibarr application.
 
The Zapier App is a small package in javascript you have to deploy on Zapier so Zapier will be able to speak the language of your Dolibarr application.
  
=== Install Node.js ===
+
===Install Node.js===
  
 
An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.
 
An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.
  
 
After installation, confirm that Node.js is ready to use:
 
After installation, confirm that Node.js is ready to use:
<syntaxHighlight>
+
<syntaxhighlight lang="bash">
node --version`
+
node --version
</syntaxHighlight>
+
</syntaxhighlight>
  
=== Install the Zapier CLI ===
+
===Install the Zapier CLI===
  
Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:
+
Next let's install the '''zapier''' CLI tools. This CLI utility will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:
  
<syntaxHighlight>
+
<syntaxhighlight lang="bash">
 
cd dev/examples/zapier
 
cd dev/examples/zapier
npm install -g zapier-platform-cli
+
npm install zapier-platform-cli
 
zapier --version
 
zapier --version
</syntaxHighlight>
+
</syntaxhighlight>
  
=== Run Zapier Login ===
+
===Run Zapier Login===
  
 
Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.
 
Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.
  
<syntaxHighlight>
+
<syntaxhighlight lang="bash">
 
zapier login
 
zapier login
</syntaxHighlight>
+
</syntaxhighlight>
  
 
This command will set up a '''.zapierrc''' file in your home directory.
 
This command will set up a '''.zapierrc''' file in your home directory.
  
=== Install the Project ===
+
===Install the Project===
  
 
In zapier examples directory, run:
 
In zapier examples directory, run:
  
<syntaxHighlight>
+
<syntaxhighlight lang="bash">
 
cd dev/examples/zapier
 
cd dev/examples/zapier
 
npm install
 
npm install
</syntaxHighlight>
+
</syntaxhighlight>
  
=== Deploying your App ===
+
===Deploying your App===
  
 
Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.
 
Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.
  
<syntaxHighlight>
+
<syntaxhighlight lang="bash">
 
zapier register  (the first time, choose name for example "My Dolibarr")
 
zapier register  (the first time, choose name for example "My Dolibarr")
 
zapier push
 
zapier push
</syntaxHighlight>
+
</syntaxhighlight>
  
After a push, the Application, with the name you defined during the register step, is available when creating a Zap.
+
After a push, the Application, with the name you defined during the register step, is available as a '''Private Application''' when creating a Zap.
  
 
You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction)
 
You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction)
  
= Usage =
+
=Usage=
 +
 
 +
===Creating a connection for the App===
 +
 
 +
Enable the REST API in Dolibarr. They are used by Zapier, starting with the login API.
 +
 
 +
Go into Zapier dashboard and create a Connection: Go into "My Apps - Custom integration", then "Add Connection".
 +
 
 +
If the App does not appear into list to add a connexion, forget this step and to to create a Zap directly, the connection creation may be asked later).
 +
If the Connection can be created, enter the URL of your Dolibarr Login page.
 +
 
 +
* The URL must not end with /. For example: https://mydomain or https://mydomain/mydoli/htdocs
 +
 
 +
Enter the login / pass of an existing account.
 +
 
 +
* For authentication, you must enter the login / pass of an existing account that will be used by Zapier to call APIs. Give the permission to this user according to the action that Zapier will ask to your Dolibarr.
 +
* If you have a SSL certificate error when accessing your web site because of an auto-signed certificate, you can disable SSL certificate check from Zapier Settings - Advanced setting.
 +
* If you web instance is protected by a HTTP Basic protection, you must keep the public URLs opened for external tool. This is a sample of the directive to use to exclude some pages to the HTTP Basic protection
 +
{{ExcludeDirForBasicHTTP}}
  
== Create a Zap ==
+
==Create a Zap==
  
Create a ZAP that use the application you registered.
+
Create a ZAP that use the application you registered from the Zapier interface https://www.zapier.com
For authentication, you must enter the login / pass of the account that will be used by Zapier to call APIs.
 

Latest revision as of 13:01, 24 May 2024

Zapier
Numéro/ID du module 50330
Doc utilisateur du module This page
Doc développeur du module Module Zapier (developer)

Introduction

This module is to manage links between Dolibarr and Zapier.

Some information and code examples are also available on this page.

Installation

This module is included with the Dolibarr distribution, so there is no need to install it.

Configuration

To use this module, you must first enable it using an administrator account, via the menu option "Home - Setup - Modules".

Choose the tab where the module is listed. Then click on "Activate".

The module is now activated.

If a cog icon appears Cog circle.svg on module thumb or at end of the line of the module, click on it to access the setup page specific to the module.


Create a Zapier developper account

At first, you need to have a Zapier developper account, create it here: Zapier Platform

Build and Deploy the "Zapier App" on Zapier platform

The Zapier App is a small package in javascript you have to deploy on Zapier so Zapier will be able to speak the language of your Dolibarr application.

Install Node.js

An easy option to get set up with Node.js is to visit [1](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.

After installation, confirm that Node.js is ready to use:

node --version

Install the Zapier CLI

Next let's install the zapier CLI tools. This CLI utility will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:

cd dev/examples/zapier
npm install zapier-platform-cli
zapier --version

Run Zapier Login

Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.

zapier login

This command will set up a .zapierrc file in your home directory.

Install the Project

In zapier examples directory, run:

cd dev/examples/zapier
npm install

Deploying your App

Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.

zapier register   (the first time, choose name for example "My Dolibarr")
zapier push

After a push, the Application, with the name you defined during the register step, is available as a Private Application when creating a Zap.

You will find original tutorial here : [2](https://zapier.com/developer/start/introduction)

Usage

Creating a connection for the App

Enable the REST API in Dolibarr. They are used by Zapier, starting with the login API.

Go into Zapier dashboard and create a Connection: Go into "My Apps - Custom integration", then "Add Connection".

If the App does not appear into list to add a connexion, forget this step and to to create a Zap directly, the connection creation may be asked later). If the Connection can be created, enter the URL of your Dolibarr Login page.

Enter the login / pass of an existing account.

  • For authentication, you must enter the login / pass of an existing account that will be used by Zapier to call APIs. Give the permission to this user according to the action that Zapier will ask to your Dolibarr.
  • If you have a SSL certificate error when accessing your web site because of an auto-signed certificate, you can disable SSL certificate check from Zapier Settings - Advanced setting.
  • If you web instance is protected by a HTTP Basic protection, you must keep the public URLs opened for external tool. This is a sample of the directive to use to exclude some pages to the HTTP Basic protection
        #leaving /public and /api and /dav accessible to everyone
        <Directory /homedirofproject/htdocs/public/>
        AuthType None
        Require all granted
        Satisfy any
        </Directory>
        <Directory /homedirofproject/htdocs/api/>
        AuthType None
        Require all granted
        Satisfy any
        </Directory>
        <Directory /homedirofproject/htdocs/dav/>
        AuthType None
        Require all granted
        Satisfy any
        </Directory>
        <Directory /homedirofproject/htdocs/.well-known/>
        AuthType None
        Require all granted
        Satisfy any
        </Directory>
        <Files ~ "(document\.php|viewimage\.php|\.js\.php|\.json\.php|\.js|\.css\.php|\.css|\.gif|\.png|\.svg|\.woff2|favicon\.ico)$">
        AuthType None
        Require all granted
        Satisfy any
        </Files>

Create a Zap

Create a ZAP that use the application you registered from the Zapier interface https://www.zapier.com