<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IPazu</id>
	<title>Dolibarr ERP CRM Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IPazu"/>
	<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php/Special:Contributions/IPazu"/>
	<updated>2026-10-30T03:20:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56542</id>
		<title>Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56542"/>
		<updated>2023-05-15T08:43:06Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;seo metak=&amp;quot;developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : Developer_documentation --&amp;gt;&lt;br /&gt;
[[fr:Documentation_Développeur]]&lt;br /&gt;
[[es:Documentación_Desarrolladores]]&lt;br /&gt;
[[de:Entwickler_Dokumentation]]&lt;br /&gt;
[[zh:开发文档]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Development organization and tools=&lt;br /&gt;
This chapter contains global information that must be read before starting any development on Dolibarr.&lt;br /&gt;
&lt;br /&gt;
#[[Dolibarr Project|Organization of project]]&lt;br /&gt;
#[[To known before to start|To be known before starting to develop]]&lt;br /&gt;
#[[Environment and development tools]]&lt;br /&gt;
#[[Dependencies and external libraries]]&lt;br /&gt;
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]&lt;br /&gt;
&lt;br /&gt;
=Coding rules and best practices=&lt;br /&gt;
&lt;br /&gt;
#[[Prerequisite|Prerequisites]]&lt;br /&gt;
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]&lt;br /&gt;
#[[:Category:Table SQL|List of tables]]&lt;br /&gt;
#Tree structure of files and classes are available in the [http://doxygen.dolibarr.org/ doxygen generated documentation]&lt;br /&gt;
&lt;br /&gt;
=List of modules=&lt;br /&gt;
Technical documentation on standard business modules is available in each module&#039;s developer documentation pages. Choose the appropriate page you are interested in:&lt;br /&gt;
&lt;br /&gt;
*[[:Category:List of Modules (developer)‎|List of standard modules]]&lt;br /&gt;
*[[:Category:Complementary modules|List of complementary modules]]&lt;br /&gt;
&lt;br /&gt;
=To develop a new module/addon for GUI=&lt;br /&gt;
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.&lt;br /&gt;
&lt;br /&gt;
Script development is not included in this section (this is described in the next chapter).&lt;br /&gt;
&lt;br /&gt;
To develop your own module, check the [[Module development]] tutorial.&lt;br /&gt;
&lt;br /&gt;
=To develop a batch or command line script=&lt;br /&gt;
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).&lt;br /&gt;
&lt;br /&gt;
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.&lt;br /&gt;
&lt;br /&gt;
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.&lt;br /&gt;
&lt;br /&gt;
=Technical components of Dolibarr=&lt;br /&gt;
==Tree structure==&lt;br /&gt;
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated &amp;quot;javadoc&amp;quot; documentation).&lt;br /&gt;
&lt;br /&gt;
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).&lt;br /&gt;
&lt;br /&gt;
==Setup storage==&lt;br /&gt;
There are 3 places for Dolibarr setup parameters.&lt;br /&gt;
&lt;br /&gt;
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: &amp;lt;code&amp;gt;/conf/conf.php&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
:See [[Configuration file]] for more information.&lt;br /&gt;
&lt;br /&gt;
*Global features parameters are stored in [[Table llx_const]].&lt;br /&gt;
&lt;br /&gt;
:See the [[Constants]] page for more information.&lt;br /&gt;
&lt;br /&gt;
*Feature parameters specific to a user are stored in [[Table llx_user_param]].&lt;br /&gt;
&lt;br /&gt;
==Business objects==&lt;br /&gt;
See [[Business Objects]] &lt;br /&gt;
&lt;br /&gt;
==Menus system==&lt;br /&gt;
See [[Menus system]] &lt;br /&gt;
&lt;br /&gt;
==Tabs system==&lt;br /&gt;
See [[Tabs system]] &lt;br /&gt;
&lt;br /&gt;
==Skins system==&lt;br /&gt;
See [[Skins]] &lt;br /&gt;
&lt;br /&gt;
==Widget system==&lt;br /&gt;
See [[Widget system]]&lt;br /&gt;
&lt;br /&gt;
==Authentication system==&lt;br /&gt;
See [[Authentication]] &lt;br /&gt;
&lt;br /&gt;
==Permission system==&lt;br /&gt;
See [[Permissions En|Permissions]] &lt;br /&gt;
&lt;br /&gt;
==Translation system==&lt;br /&gt;
See [[Translation system]] &lt;br /&gt;
&lt;br /&gt;
==Error management==&lt;br /&gt;
See [[Error reporting|Error reporting]] &lt;br /&gt;
&lt;br /&gt;
==Canvas system==&lt;br /&gt;
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.&lt;br /&gt;
 &lt;br /&gt;
See [[Canvas development]] &lt;br /&gt;
&lt;br /&gt;
==Triggers system==&lt;br /&gt;
Triggers are a development feature to execute personalized code during a Dolibarr &amp;quot;business event&amp;quot; (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the &#039;&#039;&#039;Hooks system&#039;&#039;&#039; chapter instead.&lt;br /&gt;
&lt;br /&gt;
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].&lt;br /&gt;
&lt;br /&gt;
==Hooks system==&lt;br /&gt;
See [[Hooks system]] &lt;br /&gt;
&lt;br /&gt;
==Variable substitution system==&lt;br /&gt;
See [[Variable substitution system]] &lt;br /&gt;
&lt;br /&gt;
==Web services==&lt;br /&gt;
Dolibarr can be setup to provide some services.&lt;br /&gt;
&lt;br /&gt;
See [[Module Web Services API REST (developer)]] &lt;br /&gt;
&lt;br /&gt;
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.&lt;br /&gt;
&lt;br /&gt;
==Files/Documents storage management==&lt;br /&gt;
See [[Generated documents]] &lt;br /&gt;
&lt;br /&gt;
==Numbering modules==&lt;br /&gt;
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don&#039;t meet the needs. In this case it is necessary to develop a custom numbering module.&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Create numeration module|Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
==Document templates and documents generation==&lt;br /&gt;
&lt;br /&gt;
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].&lt;br /&gt;
&lt;br /&gt;
==Extrafields==&lt;br /&gt;
See [[Extrafields]]&lt;br /&gt;
&lt;br /&gt;
==Online payment system==&lt;br /&gt;
See [[Online payment system]]&lt;br /&gt;
&lt;br /&gt;
==Other internal function==&lt;br /&gt;
There are many internal libraries your code can use.&lt;br /&gt;
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To specify a requirement based on Dolibarr version number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, to make a condition based on requiring Dolibarr version &amp;gt; 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
if (versioncompare(versiondolibarrarray(), array(3,5,0)) &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mass exports/imports=&lt;br /&gt;
&lt;br /&gt;
#[[Mass imports]]&lt;br /&gt;
#[[Module Exports En|Mass exports]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces and links with other applications=&lt;br /&gt;
&lt;br /&gt;
#[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers or Hooks)&lt;br /&gt;
#[[Interfaces from foreign systems toward Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
Integrate Dolibarr to automation platforms:&lt;br /&gt;
&lt;br /&gt;
#[[Integration of Dolibarr to the Zapier automation platform]]&lt;br /&gt;
#[[Integration of Dolibarr to the n8n automation platform]]&lt;br /&gt;
#[[Integration of Dolibarr to the Make automation platform]]&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56541</id>
		<title>Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56541"/>
		<updated>2023-05-14T20:39:40Z</updated>

		<summary type="html">&lt;p&gt;IPazu: /* Interfaces and links with other applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;seo metak=&amp;quot;developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : Developer_documentation --&amp;gt;&lt;br /&gt;
[[fr:Documentation_Développeur]]&lt;br /&gt;
[[es:Documentación_Desarrolladores]]&lt;br /&gt;
[[de:Entwickler_Dokumentation]]&lt;br /&gt;
[[zh:开发文档]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Development organization and tools=&lt;br /&gt;
This chapter contains global information that must be read before starting any development on Dolibarr.&lt;br /&gt;
&lt;br /&gt;
#[[Dolibarr Project|Organization of project]]&lt;br /&gt;
#[[To known before to start|To be known before starting to develop]]&lt;br /&gt;
#[[Environment and development tools]]&lt;br /&gt;
#[[Dependencies and external libraries]]&lt;br /&gt;
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]&lt;br /&gt;
&lt;br /&gt;
=Coding rules and best practices=&lt;br /&gt;
&lt;br /&gt;
#[[Prerequisite|Prerequisites]]&lt;br /&gt;
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]&lt;br /&gt;
#[[:Category:Table SQL|List of tables]]&lt;br /&gt;
#Tree structure of files and classes are available in the [http://doxygen.dolibarr.org/ doxygen generated documentation]&lt;br /&gt;
&lt;br /&gt;
=List of modules=&lt;br /&gt;
Technical documentation on standard business modules is available in each module&#039;s developer documentation pages. Choose the appropriate page you are interested in:&lt;br /&gt;
&lt;br /&gt;
*[[:Category:List of Modules (developer)‎|List of standard modules]]&lt;br /&gt;
*[[:Category:Complementary modules|List of complementary modules]]&lt;br /&gt;
&lt;br /&gt;
=To develop a new module/addon for GUI=&lt;br /&gt;
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.&lt;br /&gt;
&lt;br /&gt;
Script development is not included in this section (this is described in the next chapter).&lt;br /&gt;
&lt;br /&gt;
To develop your own module, check the [[Module development]] tutorial.&lt;br /&gt;
&lt;br /&gt;
=To develop a batch or command line script=&lt;br /&gt;
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).&lt;br /&gt;
&lt;br /&gt;
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.&lt;br /&gt;
&lt;br /&gt;
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.&lt;br /&gt;
&lt;br /&gt;
=Technical components of Dolibarr=&lt;br /&gt;
==Tree structure==&lt;br /&gt;
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated &amp;quot;javadoc&amp;quot; documentation).&lt;br /&gt;
&lt;br /&gt;
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).&lt;br /&gt;
&lt;br /&gt;
==Setup storage==&lt;br /&gt;
There are 3 places for Dolibarr setup parameters.&lt;br /&gt;
&lt;br /&gt;
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: &amp;lt;code&amp;gt;/conf/conf.php&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
:See [[Configuration file]] for more information.&lt;br /&gt;
&lt;br /&gt;
*Global features parameters are stored in [[Table llx_const]].&lt;br /&gt;
&lt;br /&gt;
:See the [[Constants]] page for more information.&lt;br /&gt;
&lt;br /&gt;
*Feature parameters specific to a user are stored in [[Table llx_user_param]].&lt;br /&gt;
&lt;br /&gt;
==Business objects==&lt;br /&gt;
See [[Business Objects]] &lt;br /&gt;
&lt;br /&gt;
==Menus system==&lt;br /&gt;
See [[Menus system]] &lt;br /&gt;
&lt;br /&gt;
==Tabs system==&lt;br /&gt;
See [[Tabs system]] &lt;br /&gt;
&lt;br /&gt;
==Skins system==&lt;br /&gt;
See [[Skins]] &lt;br /&gt;
&lt;br /&gt;
==Widget system==&lt;br /&gt;
See [[Widget system]]&lt;br /&gt;
&lt;br /&gt;
==Authentication system==&lt;br /&gt;
See [[Authentication]] &lt;br /&gt;
&lt;br /&gt;
==Permission system==&lt;br /&gt;
See [[Permissions En|Permissions]] &lt;br /&gt;
&lt;br /&gt;
==Translation system==&lt;br /&gt;
See [[Translation system]] &lt;br /&gt;
&lt;br /&gt;
==Error management==&lt;br /&gt;
See [[Error reporting|Error reporting]] &lt;br /&gt;
&lt;br /&gt;
==Canvas system==&lt;br /&gt;
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.&lt;br /&gt;
 &lt;br /&gt;
See [[Canvas development]] &lt;br /&gt;
&lt;br /&gt;
==Triggers system==&lt;br /&gt;
Triggers are a development feature to execute personalized code during a Dolibarr &amp;quot;business event&amp;quot; (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the &#039;&#039;&#039;Hooks system&#039;&#039;&#039; chapter instead.&lt;br /&gt;
&lt;br /&gt;
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].&lt;br /&gt;
&lt;br /&gt;
==Hooks system==&lt;br /&gt;
See [[Hooks system]] &lt;br /&gt;
&lt;br /&gt;
==Variable substitution system==&lt;br /&gt;
See [[Variable substitution system]] &lt;br /&gt;
&lt;br /&gt;
==Web services==&lt;br /&gt;
Dolibarr can be setup to provide some services.&lt;br /&gt;
&lt;br /&gt;
See [[Module Web Services API REST (developer)]] &lt;br /&gt;
&lt;br /&gt;
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.&lt;br /&gt;
&lt;br /&gt;
==Files/Documents storage management==&lt;br /&gt;
See [[Generated documents]] &lt;br /&gt;
&lt;br /&gt;
==Numbering modules==&lt;br /&gt;
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don&#039;t meet the needs. In this case it is necessary to develop a custom numbering module.&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Create numeration module|Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
==Document templates and documents generation==&lt;br /&gt;
&lt;br /&gt;
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].&lt;br /&gt;
&lt;br /&gt;
==Extrafields==&lt;br /&gt;
See [[Extrafields]]&lt;br /&gt;
&lt;br /&gt;
==Online payment system==&lt;br /&gt;
See [[Online payment system]]&lt;br /&gt;
&lt;br /&gt;
==Other internal function==&lt;br /&gt;
There are many internal libraries your code can use.&lt;br /&gt;
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To specify a requirement based on Dolibarr version number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, to make a condition based on requiring Dolibarr version &amp;gt; 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
if (versioncompare(versiondolibarrarray(), array(3,5,0)) &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mass exports/imports=&lt;br /&gt;
&lt;br /&gt;
#[[Mass imports]]&lt;br /&gt;
#[[Module Exports En|Mass exports]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces and links with other applications=&lt;br /&gt;
&lt;br /&gt;
#[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers or Hooks)&lt;br /&gt;
#[[Interfaces from foreign systems toward Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
Integrate Dolibarr to automation platforms:&lt;br /&gt;
&lt;br /&gt;
#[[Integration of Dolibarr to the Zapier automation platform]]&lt;br /&gt;
#[[Using Dolibarr node in the n8n automation platform]]&lt;br /&gt;
#[[Integration of Dolibarr to the Make automation platform]]&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56540</id>
		<title>Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56540"/>
		<updated>2023-05-14T20:39:20Z</updated>

		<summary type="html">&lt;p&gt;IPazu: /* Interfaces and links with other applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;seo metak=&amp;quot;developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : Developer_documentation --&amp;gt;&lt;br /&gt;
[[fr:Documentation_Développeur]]&lt;br /&gt;
[[es:Documentación_Desarrolladores]]&lt;br /&gt;
[[de:Entwickler_Dokumentation]]&lt;br /&gt;
[[zh:开发文档]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Development organization and tools=&lt;br /&gt;
This chapter contains global information that must be read before starting any development on Dolibarr.&lt;br /&gt;
&lt;br /&gt;
#[[Dolibarr Project|Organization of project]]&lt;br /&gt;
#[[To known before to start|To be known before starting to develop]]&lt;br /&gt;
#[[Environment and development tools]]&lt;br /&gt;
#[[Dependencies and external libraries]]&lt;br /&gt;
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]&lt;br /&gt;
&lt;br /&gt;
=Coding rules and best practices=&lt;br /&gt;
&lt;br /&gt;
#[[Prerequisite|Prerequisites]]&lt;br /&gt;
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]&lt;br /&gt;
#[[:Category:Table SQL|List of tables]]&lt;br /&gt;
#Tree structure of files and classes are available in the [http://doxygen.dolibarr.org/ doxygen generated documentation]&lt;br /&gt;
&lt;br /&gt;
=List of modules=&lt;br /&gt;
Technical documentation on standard business modules is available in each module&#039;s developer documentation pages. Choose the appropriate page you are interested in:&lt;br /&gt;
&lt;br /&gt;
*[[:Category:List of Modules (developer)‎|List of standard modules]]&lt;br /&gt;
*[[:Category:Complementary modules|List of complementary modules]]&lt;br /&gt;
&lt;br /&gt;
=To develop a new module/addon for GUI=&lt;br /&gt;
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.&lt;br /&gt;
&lt;br /&gt;
Script development is not included in this section (this is described in the next chapter).&lt;br /&gt;
&lt;br /&gt;
To develop your own module, check the [[Module development]] tutorial.&lt;br /&gt;
&lt;br /&gt;
=To develop a batch or command line script=&lt;br /&gt;
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).&lt;br /&gt;
&lt;br /&gt;
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.&lt;br /&gt;
&lt;br /&gt;
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.&lt;br /&gt;
&lt;br /&gt;
=Technical components of Dolibarr=&lt;br /&gt;
==Tree structure==&lt;br /&gt;
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated &amp;quot;javadoc&amp;quot; documentation).&lt;br /&gt;
&lt;br /&gt;
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).&lt;br /&gt;
&lt;br /&gt;
==Setup storage==&lt;br /&gt;
There are 3 places for Dolibarr setup parameters.&lt;br /&gt;
&lt;br /&gt;
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: &amp;lt;code&amp;gt;/conf/conf.php&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
:See [[Configuration file]] for more information.&lt;br /&gt;
&lt;br /&gt;
*Global features parameters are stored in [[Table llx_const]].&lt;br /&gt;
&lt;br /&gt;
:See the [[Constants]] page for more information.&lt;br /&gt;
&lt;br /&gt;
*Feature parameters specific to a user are stored in [[Table llx_user_param]].&lt;br /&gt;
&lt;br /&gt;
==Business objects==&lt;br /&gt;
See [[Business Objects]] &lt;br /&gt;
&lt;br /&gt;
==Menus system==&lt;br /&gt;
See [[Menus system]] &lt;br /&gt;
&lt;br /&gt;
==Tabs system==&lt;br /&gt;
See [[Tabs system]] &lt;br /&gt;
&lt;br /&gt;
==Skins system==&lt;br /&gt;
See [[Skins]] &lt;br /&gt;
&lt;br /&gt;
==Widget system==&lt;br /&gt;
See [[Widget system]]&lt;br /&gt;
&lt;br /&gt;
==Authentication system==&lt;br /&gt;
See [[Authentication]] &lt;br /&gt;
&lt;br /&gt;
==Permission system==&lt;br /&gt;
See [[Permissions En|Permissions]] &lt;br /&gt;
&lt;br /&gt;
==Translation system==&lt;br /&gt;
See [[Translation system]] &lt;br /&gt;
&lt;br /&gt;
==Error management==&lt;br /&gt;
See [[Error reporting|Error reporting]] &lt;br /&gt;
&lt;br /&gt;
==Canvas system==&lt;br /&gt;
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.&lt;br /&gt;
 &lt;br /&gt;
See [[Canvas development]] &lt;br /&gt;
&lt;br /&gt;
==Triggers system==&lt;br /&gt;
Triggers are a development feature to execute personalized code during a Dolibarr &amp;quot;business event&amp;quot; (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the &#039;&#039;&#039;Hooks system&#039;&#039;&#039; chapter instead.&lt;br /&gt;
&lt;br /&gt;
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].&lt;br /&gt;
&lt;br /&gt;
==Hooks system==&lt;br /&gt;
See [[Hooks system]] &lt;br /&gt;
&lt;br /&gt;
==Variable substitution system==&lt;br /&gt;
See [[Variable substitution system]] &lt;br /&gt;
&lt;br /&gt;
==Web services==&lt;br /&gt;
Dolibarr can be setup to provide some services.&lt;br /&gt;
&lt;br /&gt;
See [[Module Web Services API REST (developer)]] &lt;br /&gt;
&lt;br /&gt;
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.&lt;br /&gt;
&lt;br /&gt;
==Files/Documents storage management==&lt;br /&gt;
See [[Generated documents]] &lt;br /&gt;
&lt;br /&gt;
==Numbering modules==&lt;br /&gt;
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don&#039;t meet the needs. In this case it is necessary to develop a custom numbering module.&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Create numeration module|Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
==Document templates and documents generation==&lt;br /&gt;
&lt;br /&gt;
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].&lt;br /&gt;
&lt;br /&gt;
==Extrafields==&lt;br /&gt;
See [[Extrafields]]&lt;br /&gt;
&lt;br /&gt;
==Online payment system==&lt;br /&gt;
See [[Online payment system]]&lt;br /&gt;
&lt;br /&gt;
==Other internal function==&lt;br /&gt;
There are many internal libraries your code can use.&lt;br /&gt;
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To specify a requirement based on Dolibarr version number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, to make a condition based on requiring Dolibarr version &amp;gt; 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
if (versioncompare(versiondolibarrarray(), array(3,5,0)) &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mass exports/imports=&lt;br /&gt;
&lt;br /&gt;
#[[Mass imports]]&lt;br /&gt;
#[[Module Exports En|Mass exports]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces and links with other applications=&lt;br /&gt;
&lt;br /&gt;
#[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers or Hooks)&lt;br /&gt;
#[[Interfaces from foreign systems toward Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
Integrate Dolibarr to automation platforms&lt;br /&gt;
&lt;br /&gt;
#[[Integration of Dolibarr to the Zapier automation platform]]&lt;br /&gt;
#[[Using Dolibarr node in the n8n automation platform]]&lt;br /&gt;
#[[Integration of Dolibarr to the Make automation platform]]&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56539</id>
		<title>Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56539"/>
		<updated>2023-05-14T20:38:59Z</updated>

		<summary type="html">&lt;p&gt;IPazu: /* Interfaces and links with other applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;seo metak=&amp;quot;developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : Developer_documentation --&amp;gt;&lt;br /&gt;
[[fr:Documentation_Développeur]]&lt;br /&gt;
[[es:Documentación_Desarrolladores]]&lt;br /&gt;
[[de:Entwickler_Dokumentation]]&lt;br /&gt;
[[zh:开发文档]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Development organization and tools=&lt;br /&gt;
This chapter contains global information that must be read before starting any development on Dolibarr.&lt;br /&gt;
&lt;br /&gt;
#[[Dolibarr Project|Organization of project]]&lt;br /&gt;
#[[To known before to start|To be known before starting to develop]]&lt;br /&gt;
#[[Environment and development tools]]&lt;br /&gt;
#[[Dependencies and external libraries]]&lt;br /&gt;
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]&lt;br /&gt;
&lt;br /&gt;
=Coding rules and best practices=&lt;br /&gt;
&lt;br /&gt;
#[[Prerequisite|Prerequisites]]&lt;br /&gt;
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]&lt;br /&gt;
#[[:Category:Table SQL|List of tables]]&lt;br /&gt;
#Tree structure of files and classes are available in the [http://doxygen.dolibarr.org/ doxygen generated documentation]&lt;br /&gt;
&lt;br /&gt;
=List of modules=&lt;br /&gt;
Technical documentation on standard business modules is available in each module&#039;s developer documentation pages. Choose the appropriate page you are interested in:&lt;br /&gt;
&lt;br /&gt;
*[[:Category:List of Modules (developer)‎|List of standard modules]]&lt;br /&gt;
*[[:Category:Complementary modules|List of complementary modules]]&lt;br /&gt;
&lt;br /&gt;
=To develop a new module/addon for GUI=&lt;br /&gt;
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.&lt;br /&gt;
&lt;br /&gt;
Script development is not included in this section (this is described in the next chapter).&lt;br /&gt;
&lt;br /&gt;
To develop your own module, check the [[Module development]] tutorial.&lt;br /&gt;
&lt;br /&gt;
=To develop a batch or command line script=&lt;br /&gt;
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).&lt;br /&gt;
&lt;br /&gt;
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.&lt;br /&gt;
&lt;br /&gt;
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.&lt;br /&gt;
&lt;br /&gt;
=Technical components of Dolibarr=&lt;br /&gt;
==Tree structure==&lt;br /&gt;
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated &amp;quot;javadoc&amp;quot; documentation).&lt;br /&gt;
&lt;br /&gt;
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).&lt;br /&gt;
&lt;br /&gt;
==Setup storage==&lt;br /&gt;
There are 3 places for Dolibarr setup parameters.&lt;br /&gt;
&lt;br /&gt;
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: &amp;lt;code&amp;gt;/conf/conf.php&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
:See [[Configuration file]] for more information.&lt;br /&gt;
&lt;br /&gt;
*Global features parameters are stored in [[Table llx_const]].&lt;br /&gt;
&lt;br /&gt;
:See the [[Constants]] page for more information.&lt;br /&gt;
&lt;br /&gt;
*Feature parameters specific to a user are stored in [[Table llx_user_param]].&lt;br /&gt;
&lt;br /&gt;
==Business objects==&lt;br /&gt;
See [[Business Objects]] &lt;br /&gt;
&lt;br /&gt;
==Menus system==&lt;br /&gt;
See [[Menus system]] &lt;br /&gt;
&lt;br /&gt;
==Tabs system==&lt;br /&gt;
See [[Tabs system]] &lt;br /&gt;
&lt;br /&gt;
==Skins system==&lt;br /&gt;
See [[Skins]] &lt;br /&gt;
&lt;br /&gt;
==Widget system==&lt;br /&gt;
See [[Widget system]]&lt;br /&gt;
&lt;br /&gt;
==Authentication system==&lt;br /&gt;
See [[Authentication]] &lt;br /&gt;
&lt;br /&gt;
==Permission system==&lt;br /&gt;
See [[Permissions En|Permissions]] &lt;br /&gt;
&lt;br /&gt;
==Translation system==&lt;br /&gt;
See [[Translation system]] &lt;br /&gt;
&lt;br /&gt;
==Error management==&lt;br /&gt;
See [[Error reporting|Error reporting]] &lt;br /&gt;
&lt;br /&gt;
==Canvas system==&lt;br /&gt;
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.&lt;br /&gt;
 &lt;br /&gt;
See [[Canvas development]] &lt;br /&gt;
&lt;br /&gt;
==Triggers system==&lt;br /&gt;
Triggers are a development feature to execute personalized code during a Dolibarr &amp;quot;business event&amp;quot; (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the &#039;&#039;&#039;Hooks system&#039;&#039;&#039; chapter instead.&lt;br /&gt;
&lt;br /&gt;
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].&lt;br /&gt;
&lt;br /&gt;
==Hooks system==&lt;br /&gt;
See [[Hooks system]] &lt;br /&gt;
&lt;br /&gt;
==Variable substitution system==&lt;br /&gt;
See [[Variable substitution system]] &lt;br /&gt;
&lt;br /&gt;
==Web services==&lt;br /&gt;
Dolibarr can be setup to provide some services.&lt;br /&gt;
&lt;br /&gt;
See [[Module Web Services API REST (developer)]] &lt;br /&gt;
&lt;br /&gt;
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.&lt;br /&gt;
&lt;br /&gt;
==Files/Documents storage management==&lt;br /&gt;
See [[Generated documents]] &lt;br /&gt;
&lt;br /&gt;
==Numbering modules==&lt;br /&gt;
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don&#039;t meet the needs. In this case it is necessary to develop a custom numbering module.&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Create numeration module|Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
==Document templates and documents generation==&lt;br /&gt;
&lt;br /&gt;
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].&lt;br /&gt;
&lt;br /&gt;
==Extrafields==&lt;br /&gt;
See [[Extrafields]]&lt;br /&gt;
&lt;br /&gt;
==Online payment system==&lt;br /&gt;
See [[Online payment system]]&lt;br /&gt;
&lt;br /&gt;
==Other internal function==&lt;br /&gt;
There are many internal libraries your code can use.&lt;br /&gt;
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To specify a requirement based on Dolibarr version number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, to make a condition based on requiring Dolibarr version &amp;gt; 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
if (versioncompare(versiondolibarrarray(), array(3,5,0)) &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mass exports/imports=&lt;br /&gt;
&lt;br /&gt;
#[[Mass imports]]&lt;br /&gt;
#[[Module Exports En|Mass exports]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces and links with other applications=&lt;br /&gt;
&lt;br /&gt;
#[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers or Hooks)&lt;br /&gt;
#[[Interfaces from foreign systems toward Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
===Integrate Dolibarr to automation platforms===&lt;br /&gt;
&lt;br /&gt;
#[[Integration of Dolibarr to the Zapier automation platform]]&lt;br /&gt;
#[[Using Dolibarr node in the n8n automation platform]]&lt;br /&gt;
#[[Integration of Dolibarr to the Make automation platform]]&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56538</id>
		<title>Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Developer_documentation&amp;diff=56538"/>
		<updated>2023-05-14T20:38:32Z</updated>

		<summary type="html">&lt;p&gt;IPazu: /* Interfaces and links with other applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;seo metak=&amp;quot;developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- BEGIN interlang links --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Do NOT edit this section&lt;br /&gt;
     Links below are automatically managed by PolyglotBot&lt;br /&gt;
     You can edit links on the English source page : Developer_documentation --&amp;gt;&lt;br /&gt;
[[fr:Documentation_Développeur]]&lt;br /&gt;
[[es:Documentación_Desarrolladores]]&lt;br /&gt;
[[de:Entwickler_Dokumentation]]&lt;br /&gt;
[[zh:开发文档]]&lt;br /&gt;
&amp;lt;!-- END interlang links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Development organization and tools=&lt;br /&gt;
This chapter contains global information that must be read before starting any development on Dolibarr.&lt;br /&gt;
&lt;br /&gt;
#[[Dolibarr Project|Organization of project]]&lt;br /&gt;
#[[To known before to start|To be known before starting to develop]]&lt;br /&gt;
#[[Environment and development tools]]&lt;br /&gt;
#[[Dependencies and external libraries]]&lt;br /&gt;
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]&lt;br /&gt;
&lt;br /&gt;
=Coding rules and best practices=&lt;br /&gt;
&lt;br /&gt;
#[[Prerequisite|Prerequisites]]&lt;br /&gt;
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]&lt;br /&gt;
#[[:Category:Table SQL|List of tables]]&lt;br /&gt;
#Tree structure of files and classes are available in the [http://doxygen.dolibarr.org/ doxygen generated documentation]&lt;br /&gt;
&lt;br /&gt;
=List of modules=&lt;br /&gt;
Technical documentation on standard business modules is available in each module&#039;s developer documentation pages. Choose the appropriate page you are interested in:&lt;br /&gt;
&lt;br /&gt;
*[[:Category:List of Modules (developer)‎|List of standard modules]]&lt;br /&gt;
*[[:Category:Complementary modules|List of complementary modules]]&lt;br /&gt;
&lt;br /&gt;
=To develop a new module/addon for GUI=&lt;br /&gt;
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.&lt;br /&gt;
&lt;br /&gt;
Script development is not included in this section (this is described in the next chapter).&lt;br /&gt;
&lt;br /&gt;
To develop your own module, check the [[Module development]] tutorial.&lt;br /&gt;
&lt;br /&gt;
=To develop a batch or command line script=&lt;br /&gt;
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).&lt;br /&gt;
&lt;br /&gt;
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.&lt;br /&gt;
&lt;br /&gt;
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.&lt;br /&gt;
&lt;br /&gt;
=Technical components of Dolibarr=&lt;br /&gt;
==Tree structure==&lt;br /&gt;
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated &amp;quot;javadoc&amp;quot; documentation).&lt;br /&gt;
&lt;br /&gt;
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).&lt;br /&gt;
&lt;br /&gt;
==Setup storage==&lt;br /&gt;
There are 3 places for Dolibarr setup parameters.&lt;br /&gt;
&lt;br /&gt;
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: &amp;lt;code&amp;gt;/conf/conf.php&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
:See [[Configuration file]] for more information.&lt;br /&gt;
&lt;br /&gt;
*Global features parameters are stored in [[Table llx_const]].&lt;br /&gt;
&lt;br /&gt;
:See the [[Constants]] page for more information.&lt;br /&gt;
&lt;br /&gt;
*Feature parameters specific to a user are stored in [[Table llx_user_param]].&lt;br /&gt;
&lt;br /&gt;
==Business objects==&lt;br /&gt;
See [[Business Objects]] &lt;br /&gt;
&lt;br /&gt;
==Menus system==&lt;br /&gt;
See [[Menus system]] &lt;br /&gt;
&lt;br /&gt;
==Tabs system==&lt;br /&gt;
See [[Tabs system]] &lt;br /&gt;
&lt;br /&gt;
==Skins system==&lt;br /&gt;
See [[Skins]] &lt;br /&gt;
&lt;br /&gt;
==Widget system==&lt;br /&gt;
See [[Widget system]]&lt;br /&gt;
&lt;br /&gt;
==Authentication system==&lt;br /&gt;
See [[Authentication]] &lt;br /&gt;
&lt;br /&gt;
==Permission system==&lt;br /&gt;
See [[Permissions En|Permissions]] &lt;br /&gt;
&lt;br /&gt;
==Translation system==&lt;br /&gt;
See [[Translation system]] &lt;br /&gt;
&lt;br /&gt;
==Error management==&lt;br /&gt;
See [[Error reporting|Error reporting]] &lt;br /&gt;
&lt;br /&gt;
==Canvas system==&lt;br /&gt;
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.&lt;br /&gt;
 &lt;br /&gt;
See [[Canvas development]] &lt;br /&gt;
&lt;br /&gt;
==Triggers system==&lt;br /&gt;
Triggers are a development feature to execute personalized code during a Dolibarr &amp;quot;business event&amp;quot; (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the &#039;&#039;&#039;Hooks system&#039;&#039;&#039; chapter instead.&lt;br /&gt;
&lt;br /&gt;
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].&lt;br /&gt;
&lt;br /&gt;
==Hooks system==&lt;br /&gt;
See [[Hooks system]] &lt;br /&gt;
&lt;br /&gt;
==Variable substitution system==&lt;br /&gt;
See [[Variable substitution system]] &lt;br /&gt;
&lt;br /&gt;
==Web services==&lt;br /&gt;
Dolibarr can be setup to provide some services.&lt;br /&gt;
&lt;br /&gt;
See [[Module Web Services API REST (developer)]] &lt;br /&gt;
&lt;br /&gt;
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.&lt;br /&gt;
&lt;br /&gt;
==Files/Documents storage management==&lt;br /&gt;
See [[Generated documents]] &lt;br /&gt;
&lt;br /&gt;
==Numbering modules==&lt;br /&gt;
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don&#039;t meet the needs. In this case it is necessary to develop a custom numbering module.&lt;br /&gt;
&lt;br /&gt;
For more information, see [[Create numeration module|Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
==Document templates and documents generation==&lt;br /&gt;
&lt;br /&gt;
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].&lt;br /&gt;
&lt;br /&gt;
==Extrafields==&lt;br /&gt;
See [[Extrafields]]&lt;br /&gt;
&lt;br /&gt;
==Online payment system==&lt;br /&gt;
See [[Online payment system]]&lt;br /&gt;
&lt;br /&gt;
==Other internal function==&lt;br /&gt;
There are many internal libraries your code can use.&lt;br /&gt;
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To specify a requirement based on Dolibarr version number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example, to make a condition based on requiring Dolibarr version &amp;gt; 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;PHP&amp;quot;&amp;gt;&lt;br /&gt;
if (versioncompare(versiondolibarrarray(), array(3,5,0)) &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Mass exports/imports=&lt;br /&gt;
&lt;br /&gt;
#[[Mass imports]]&lt;br /&gt;
#[[Module Exports En|Mass exports]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces and links with other applications=&lt;br /&gt;
&lt;br /&gt;
#[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers or Hooks)&lt;br /&gt;
#[[Interfaces from foreign systems toward Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
== Integrate Dolibarr to automation platforms ==&lt;br /&gt;
&lt;br /&gt;
# [[Integration of Dolibarr to the Zapier automation platform]]&lt;br /&gt;
# [[Using Dolibarr node in the n8n automation platform]]&lt;br /&gt;
# [[Integration of Dolibarr to the Make automation platform]]&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56537</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56537"/>
		<updated>2023-05-14T20:34:51Z</updated>

		<summary type="html">&lt;p&gt;IPazu: /* Example of module to create events in the Dolibarr calendar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites:&lt;br /&gt;
&lt;br /&gt;
*You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol)&lt;br /&gt;
*You have access to a user account with administrator rights&lt;br /&gt;
*You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation])&lt;br /&gt;
*You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-make-application&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Make application=&lt;br /&gt;
&lt;br /&gt;
#Go to https://eu1.make.com and log into your user account&lt;br /&gt;
#Go to the &amp;lt;code&amp;gt;My Apps&amp;lt;/code&amp;gt; tab&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;Create a new app&amp;lt;/code&amp;gt;. You can call it &amp;lt;code&amp;gt;Dolibarr&amp;lt;/code&amp;gt;. This instance will contain a connection and several modules that will implement specific features such as &#039;&#039;&#039;creation of a task&#039;&#039;&#039; or &#039;&#039;&#039;creation of an event&#039;&#039;&#039; for instance.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Base&amp;lt;/code&amp;gt; tab, you just have to write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab and &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NB : The applications that a user can create on Make are written in &amp;lt;code&amp;gt;json&amp;lt;/code&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==a) &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab==&lt;br /&gt;
&lt;br /&gt;
There are three required parameters for the connection : the &#039;&#039;Dolibarr API key&#039;&#039;, the &#039;&#039;URL of the Dolibarr instance&#039;&#039; (&amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt; for instance) and your &#039;&#039;user ID&#039;&#039;. It means these parameters require some values in order to create a connection. Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==b) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab==&lt;br /&gt;
&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;log&amp;quot;: {&lt;br /&gt;
        &amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action-module&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action module=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-module-to-create-events-in-the-dolibarr-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Example of module to create events in the Dolibarr calendar==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case : &#039;&#039;As soon as you receive a mail on an Email box, report it in Dolibarr events&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call &amp;lt;code&amp;gt;Creation of an event&amp;lt;/code&amp;gt;. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
        &amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
        &amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
        &amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation of the different required fields :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!API field&lt;br /&gt;
!Description&lt;br /&gt;
!Type&lt;br /&gt;
!Possible value&lt;br /&gt;
|-&lt;br /&gt;
|type&lt;br /&gt;
|Event type&lt;br /&gt;
|text&lt;br /&gt;
|Email reception&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|Event label&lt;br /&gt;
|text&lt;br /&gt;
|New emails received&lt;br /&gt;
|-&lt;br /&gt;
|type_code&lt;br /&gt;
|Dolibarr event type code&lt;br /&gt;
|number&lt;br /&gt;
|&#039;&#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|userownerid&lt;br /&gt;
|Dolibarr user that create the event&lt;br /&gt;
|number&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|email_sender&lt;br /&gt;
|Login of the sender&lt;br /&gt;
|text&lt;br /&gt;
|jdoe&lt;br /&gt;
|-&lt;br /&gt;
|email_from&lt;br /&gt;
|Email address of the sender&lt;br /&gt;
|text&lt;br /&gt;
|john@doe.org&lt;br /&gt;
|-&lt;br /&gt;
|status&lt;br /&gt;
|&lt;br /&gt;
|number&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|percentage&lt;br /&gt;
|Event progress&lt;br /&gt;
|number between -1 (N/A) and 100&lt;br /&gt;
| -1&lt;br /&gt;
|-&lt;br /&gt;
|date_creation&lt;br /&gt;
|Date of creation of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|Start date of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|End date of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The type_code “6” corresponds to the event type “Email reception”.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
        &amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;st-scenario-report-an-email-in-dolibarr-events&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==1st scenario : Report an email in Dolibarr events==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===1) Create a new scenario===&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;email-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===2) Email scenario configuration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-email-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.a) Email scenario initialization====&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Email&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Watch Emails&amp;lt;/code&amp;gt; trigger of this module. To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-email-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.b) Email module configuration====&lt;br /&gt;
&lt;br /&gt;
#First, choose the &#039;&#039;&#039;connection&#039;&#039;&#039; : select the IMAP connection that you configured (named &#039;&#039;My others IMAP connection&#039;&#039;)&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;/INBOX&amp;lt;/code&amp;gt; &#039;&#039;&#039;folder&#039;&#039;&#039;&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Only unread mails&amp;lt;/code&amp;gt; &#039;&#039;&#039;criteria&#039;&#039;&#039;&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mark message(s) as read when fetched&amp;lt;/code&amp;gt; unless you want to mark messages as read.&lt;br /&gt;
#Don’t forget to click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt; at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.c) Dolibarr module configuration====&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt; action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below :&lt;br /&gt;
&lt;br /&gt;
#Select the right &#039;&#039;&#039;connection&#039;&#039;&#039;&lt;br /&gt;
#Select the &#039;&#039;&#039;Email address&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Address&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Name&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Name&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Mail label&#039;&#039;&#039; with &amp;lt;code&amp;gt;&amp;amp;quot;1. Sender Email Name&amp;amp;quot; : &amp;amp;quot;1. Subject&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Received on&#039;&#039;&#039; field : &amp;lt;code&amp;gt;1.Date&amp;lt;/code&amp;gt;&lt;br /&gt;
#Choose the &#039;&#039;&#039;Type&#039;&#039;&#039; : 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;7&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-a-module-implementation-to-create-a-project-task-on-dolibarr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Example of a module implementation to create a project task on Dolibarr==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“Creation of a project task in Dolibarr once an issue is created on Github”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (&amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; tab, &amp;lt;code&amp;gt;Tasks/Activities&amp;lt;/code&amp;gt; section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module &amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Required fields :&#039;&#039;&#039; There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the &amp;lt;code&amp;gt;Task list&amp;lt;/code&amp;gt; columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!API field&lt;br /&gt;
!Description&lt;br /&gt;
!Type&lt;br /&gt;
!Possible value&lt;br /&gt;
|-&lt;br /&gt;
|ref&lt;br /&gt;
|Task reference&lt;br /&gt;
|text&lt;br /&gt;
|K2304-0005&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|Task label&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|fk_project&lt;br /&gt;
|Project reference&lt;br /&gt;
|number&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|date_start&lt;br /&gt;
|Start date&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|date_end&lt;br /&gt;
|End date&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|date_creation&lt;br /&gt;
|Date of creation&lt;br /&gt;
|date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|user_creation&lt;br /&gt;
|User that created the task&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|planned_workload&lt;br /&gt;
|Estimated completion time (in seconds)&lt;br /&gt;
|number&lt;br /&gt;
|8400&lt;br /&gt;
|-&lt;br /&gt;
|duration_effective&lt;br /&gt;
|Percentage of actual progress&lt;br /&gt;
|number&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|fk_user_creat&lt;br /&gt;
|ID of the user that created the event&lt;br /&gt;
|number&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|progress&lt;br /&gt;
|Progress of the project (in %)&lt;br /&gt;
|number between 0 and 100&lt;br /&gt;
|50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting up the Github OAuth connection :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
#Click the &amp;lt;code&amp;gt;Add button&amp;lt;/code&amp;gt; next to the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; field. Select the &#039;&#039;&#039;Connection type&#039;&#039;&#039; as OAuth.&lt;br /&gt;
#Optional: In the &#039;&#039;&#039;Connection name&#039;&#039;&#039; field, enter a name for the connection.&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;Save&amp;lt;/code&amp;gt;.&lt;br /&gt;
#a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }   &lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;nd-scenario-create-a-task-in-dolibarr-when-a-new-issue-is-created-on-github&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==2nd scenario : Create a task in Dolibarr when a new issue is created on Github==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===1) Create a new scenario===&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;github-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===2) Github scenario configuration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-github-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.a) Github scenario initialization====&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Github&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Watch issues&amp;lt;/code&amp;gt; trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-github-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.b) Github module configuration====&lt;br /&gt;
&lt;br /&gt;
#First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
#Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the &#039;&#039;&#039;I want to watch&#039;&#039;&#039; field.&lt;br /&gt;
#Select the repository from which we want to launch the scenario on the &#039;&#039;&#039;repository&#039;&#039;&#039; field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
#Choose the &#039;&#039;&#039;maximum number of returned issues&#039;&#039;&#039; : 10 for example&lt;br /&gt;
#Fill the &#039;&#039;&#039;watch&#039;&#039;&#039; field : select &amp;lt;code&amp;gt;only new issues&amp;lt;/code&amp;gt;&lt;br /&gt;
#Then, select the &#039;&#039;&#039;filter&#039;&#039;&#039; : &amp;lt;code&amp;gt;all issues&amp;lt;/code&amp;gt;(for example)&lt;br /&gt;
#Finally, select the &#039;&#039;&#039;state&#039;&#039;&#039; : &amp;lt;code&amp;gt;only opened issues&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.c) Dolibarr module configuration====&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;Task created by&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Creator&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Name of task&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Title&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of creation&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of start&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Project ID&#039;&#039;&#039; : &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of end&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date updated&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;rd-scenario-create-a-new-event-in-the-dolibarr-calendar-when-creating-one-in-google-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar==&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; among the several propositions. After, in the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; section, add a connection with your Google account and accept the terms. In the &amp;lt;code&amp;gt;Calendar&amp;lt;/code&amp;gt; section, choose your calendar account. Then, in the &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Event name&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Summary&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Start time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Start&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;End time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. End&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Location&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Location&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Description&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Description&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Email adress&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Organizer: Email&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;help-for-developpers&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Help for developpers=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-the-code-on-vscode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Viewing the code on VSCode==&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the &amp;lt;code&amp;gt;Make Apps SDK&amp;lt;/code&amp;gt; extension. More details can be found on the [https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code extension configuration page].&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56536</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56536"/>
		<updated>2023-05-14T20:25:46Z</updated>

		<summary type="html">&lt;p&gt;IPazu: minor changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Preamble==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: &lt;br /&gt;
&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) &lt;br /&gt;
* You have access to a user account with administrator rights &lt;br /&gt;
* You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) &lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Zapier integration=&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin. You will be asked for different information: &lt;br /&gt;
&lt;br /&gt;
* A name for your integration &lt;br /&gt;
* A description &lt;br /&gt;
* A website URL &lt;br /&gt;
* A logo &lt;br /&gt;
* The audience targeted by your integration (public or private) &lt;br /&gt;
* Your role in the development of the integration (employee, hired, independent)&lt;br /&gt;
* The category of your integration&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the Zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring Authentication Fields==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Password&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the token exchange request==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: Configuring the test request==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the connection==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index&amp;lt;/code&amp;gt; endpoint. &amp;lt;code&amp;gt;php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create a trigger=&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action=&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
*&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring the action==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Create&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Noun&lt;br /&gt;
|&amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Visibility Options&lt;br /&gt;
|Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the fields==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Label&lt;br /&gt;
!Key&lt;br /&gt;
!Type&lt;br /&gt;
!Required&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|&amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|&amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
|Text&lt;br /&gt;
|❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: API configuration==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===API request configuration===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Testing the request to the API===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|&amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|location&lt;br /&gt;
|&amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|note_private&lt;br /&gt;
|&amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Configuration of the data returned by the API===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the action in a “Zap”==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Trigger setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Action Setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
|Event name&lt;br /&gt;
|Summary&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|Location&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Validate and publish the integration=&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Go further=&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56535</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56535"/>
		<updated>2023-05-14T19:35:13Z</updated>

		<summary type="html">&lt;p&gt;IPazu: removing title and fixing lists&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites:&lt;br /&gt;
&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) &lt;br /&gt;
* You have access to a user account with administrator rights &lt;br /&gt;
* You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) &lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-make-application&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Make application=&lt;br /&gt;
&lt;br /&gt;
#Go to https://eu1.make.com and log into your user account&lt;br /&gt;
#Go to the &amp;lt;code&amp;gt;My Apps&amp;lt;/code&amp;gt; tab&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;Create a new app&amp;lt;/code&amp;gt;. You can call it &amp;lt;code&amp;gt;Dolibarr&amp;lt;/code&amp;gt;. This instance will contain a connection and several modules that will implement specific features such as &#039;&#039;&#039;creation of a task&#039;&#039;&#039; or &#039;&#039;&#039;creation of an event&#039;&#039;&#039; for instance.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Base&amp;lt;/code&amp;gt; tab, you just have to write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab and &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NB : The applications that a user can create on Make are written in &amp;lt;code&amp;gt;json&amp;lt;/code&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==a) &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab==&lt;br /&gt;
&lt;br /&gt;
There are three required parameters for the connection : the &#039;&#039;Dolibarr API key&#039;&#039;, the &#039;&#039;URL of the Dolibarr instance&#039;&#039; (&amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt; for instance) and your &#039;&#039;user ID&#039;&#039;. It means these parameters require some values in order to create a connection. Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==b) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab==&lt;br /&gt;
&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;log&amp;quot;: {&lt;br /&gt;
        &amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action-module&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action module=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-module-to-create-events-in-the-dolibarr-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Example of module to create events in the Dolibarr calendar==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case : &amp;amp;gt;“As soon as you receive a mail on an Email box, report it in Dolibarr events”&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call &amp;lt;code&amp;gt;Creation of an event&amp;lt;/code&amp;gt;. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
        &amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
        &amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
        &amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation of the different required fields :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!API field&lt;br /&gt;
!Description&lt;br /&gt;
!Type&lt;br /&gt;
!Possible value&lt;br /&gt;
|-&lt;br /&gt;
|type&lt;br /&gt;
|Event type&lt;br /&gt;
|text&lt;br /&gt;
|Email reception&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|Event label&lt;br /&gt;
|text&lt;br /&gt;
|New emails received&lt;br /&gt;
|-&lt;br /&gt;
|type_code&lt;br /&gt;
|Dolibarr event type code&lt;br /&gt;
|number&lt;br /&gt;
|&#039;&#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|userownerid&lt;br /&gt;
|Dolibarr user that create the event&lt;br /&gt;
|number&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|email_sender&lt;br /&gt;
|Login of the sender&lt;br /&gt;
|text&lt;br /&gt;
|jdoe&lt;br /&gt;
|-&lt;br /&gt;
|email_from&lt;br /&gt;
|Email address of the sender&lt;br /&gt;
|text&lt;br /&gt;
|john@doe.org&lt;br /&gt;
|-&lt;br /&gt;
|status&lt;br /&gt;
|&lt;br /&gt;
|number&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|percentage&lt;br /&gt;
|Event progress&lt;br /&gt;
|number between -1 (N/A) and 100&lt;br /&gt;
| -1&lt;br /&gt;
|-&lt;br /&gt;
|date_creation&lt;br /&gt;
|Date of creation of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|Start date of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|End date of the event&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The type_code “6” corresponds to the event type “Email reception”.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
        &amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;st-scenario-report-an-email-in-dolibarr-events&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==1st scenario : Report an email in Dolibarr events==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===1) Create a new scenario===&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;email-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===2) Email scenario configuration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-email-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.a) Email scenario initialization====&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Email&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Watch Emails&amp;lt;/code&amp;gt; trigger of this module. To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-email-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.b) Email module configuration====&lt;br /&gt;
&lt;br /&gt;
#First, choose the &#039;&#039;&#039;connection&#039;&#039;&#039; : select the IMAP connection that you configured (named &#039;&#039;My others IMAP connection&#039;&#039;)&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;/INBOX&amp;lt;/code&amp;gt; &#039;&#039;&#039;folder&#039;&#039;&#039;&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Only unread mails&amp;lt;/code&amp;gt; &#039;&#039;&#039;criteria&#039;&#039;&#039;&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mark message(s) as read when fetched&amp;lt;/code&amp;gt; unless you want to mark messages as read.&lt;br /&gt;
#Don’t forget to click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt; at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.c) Dolibarr module configuration====&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt; action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below :&lt;br /&gt;
&lt;br /&gt;
#Select the right &#039;&#039;&#039;connection&#039;&#039;&#039;&lt;br /&gt;
#Select the &#039;&#039;&#039;Email address&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Address&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Name&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Name&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Mail label&#039;&#039;&#039; with &amp;lt;code&amp;gt;&amp;amp;quot;1. Sender Email Name&amp;amp;quot; : &amp;amp;quot;1. Subject&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#Select the &#039;&#039;&#039;Received on&#039;&#039;&#039; field : &amp;lt;code&amp;gt;1.Date&amp;lt;/code&amp;gt;&lt;br /&gt;
#Choose the &#039;&#039;&#039;Type&#039;&#039;&#039; : 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;7&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-a-module-implementation-to-create-a-project-task-on-dolibarr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Example of a module implementation to create a project task on Dolibarr==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“Creation of a project task in Dolibarr once an issue is created on Github”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (&amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; tab, &amp;lt;code&amp;gt;Tasks/Activities&amp;lt;/code&amp;gt; section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module &amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Required fields :&#039;&#039;&#039; There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the &amp;lt;code&amp;gt;Task list&amp;lt;/code&amp;gt; columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!API field&lt;br /&gt;
!Description&lt;br /&gt;
!Type&lt;br /&gt;
!Possible value&lt;br /&gt;
|-&lt;br /&gt;
|ref&lt;br /&gt;
|Task reference&lt;br /&gt;
|text&lt;br /&gt;
|K2304-0005&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|Task label&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|fk_project&lt;br /&gt;
|Project reference&lt;br /&gt;
|number&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|date_start&lt;br /&gt;
|Start date&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|date_end&lt;br /&gt;
|End date&lt;br /&gt;
|date&lt;br /&gt;
|2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
|date_creation&lt;br /&gt;
|Date of creation&lt;br /&gt;
|date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|user_creation&lt;br /&gt;
|User that created the task&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|planned_workload&lt;br /&gt;
|Estimated completion time (in seconds)&lt;br /&gt;
|number&lt;br /&gt;
|8400&lt;br /&gt;
|-&lt;br /&gt;
|duration_effective&lt;br /&gt;
|Percentage of actual progress&lt;br /&gt;
|number&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|fk_user_creat&lt;br /&gt;
|ID of the user that created the event&lt;br /&gt;
|number&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|progress&lt;br /&gt;
|Progress of the project (in %)&lt;br /&gt;
|number between 0 and 100&lt;br /&gt;
|50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting up the Github OAuth connection :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
#Click the &amp;lt;code&amp;gt;Add button&amp;lt;/code&amp;gt; next to the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; field. Select the &#039;&#039;&#039;Connection type&#039;&#039;&#039; as OAuth.&lt;br /&gt;
#Optional: In the &#039;&#039;&#039;Connection name&#039;&#039;&#039; field, enter a name for the connection.&lt;br /&gt;
#Click on &amp;lt;code&amp;gt;Save&amp;lt;/code&amp;gt;.&lt;br /&gt;
#a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }   &lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;nd-scenario-create-a-task-in-dolibarr-when-a-new-issue-is-created-on-github&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==2nd scenario : Create a task in Dolibarr when a new issue is created on Github==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===1) Create a new scenario===&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;github-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===2) Github scenario configuration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-github-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.a) Github scenario initialization====&lt;br /&gt;
&lt;br /&gt;
#Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Github&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
#Select the &amp;lt;code&amp;gt;Watch issues&amp;lt;/code&amp;gt; trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-github-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.b) Github module configuration====&lt;br /&gt;
&lt;br /&gt;
#First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
#Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the &#039;&#039;&#039;I want to watch&#039;&#039;&#039; field.&lt;br /&gt;
#Select the repository from which we want to launch the scenario on the &#039;&#039;&#039;repository&#039;&#039;&#039; field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
#Choose the &#039;&#039;&#039;maximum number of returned issues&#039;&#039;&#039; : 10 for example&lt;br /&gt;
#Fill the &#039;&#039;&#039;watch&#039;&#039;&#039; field : select &amp;lt;code&amp;gt;only new issues&amp;lt;/code&amp;gt;&lt;br /&gt;
#Then, select the &#039;&#039;&#039;filter&#039;&#039;&#039; : &amp;lt;code&amp;gt;all issues&amp;lt;/code&amp;gt;(for example)&lt;br /&gt;
#Finally, select the &#039;&#039;&#039;state&#039;&#039;&#039; : &amp;lt;code&amp;gt;only opened issues&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
====2.c) Dolibarr module configuration====&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;Task created by&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Creator&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Name of task&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Title&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of creation&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of start&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Project ID&#039;&#039;&#039; : &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
#&#039;&#039;&#039;Date of end&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date updated&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;rd-scenario-create-a-new-event-in-the-dolibarr-calendar-when-creating-one-in-google-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar==&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; among the several propositions. After, in the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; section, add a connection with your Google account and accept the terms. In the &amp;lt;code&amp;gt;Calendar&amp;lt;/code&amp;gt; section, choose your calendar account. Then, in the &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Event name&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Summary&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Start time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Start&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;End time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. End&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Location&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Location&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Description&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Description&amp;lt;/code&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Email adress&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Organizer: Email&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;help-for-developpers&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Help for developpers=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-the-code-on-vscode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Viewing the code on VSCode==&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the &amp;lt;code&amp;gt;Make Apps SDK&amp;lt;/code&amp;gt; extension. More details can be found on the [https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code extension configuration page].&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56534</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56534"/>
		<updated>2023-05-14T19:33:29Z</updated>

		<summary type="html">&lt;p&gt;IPazu: removing title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Preamble==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: &lt;br /&gt;
&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) &lt;br /&gt;
* You have access to a user account with administrator rights &lt;br /&gt;
* You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) &lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Zapier integration=&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin. You will be asked for different information: &lt;br /&gt;
&lt;br /&gt;
* A name for your integration &lt;br /&gt;
* A description &lt;br /&gt;
* A website URL &lt;br /&gt;
* A logo &lt;br /&gt;
* The audience targeted by your integration (public or private) &lt;br /&gt;
* Your role in the development of the integration (employee, hired, independent)&lt;br /&gt;
* The category of your integration&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring Authentication Fields==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Password&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the token exchange request==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: Configuring the test request==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: {{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}}) which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the connection==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index&amp;lt;/code&amp;gt; endpoint. &amp;lt;code&amp;gt;php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create a trigger=&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action=&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
*&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring the action==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Create&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Noun&lt;br /&gt;
|&amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Visibility Options&lt;br /&gt;
|Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the fields==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Label&lt;br /&gt;
!Key&lt;br /&gt;
!Type&lt;br /&gt;
!Required&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|&amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|&amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
|Text&lt;br /&gt;
|❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: API configuration==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===API request configuration===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Testing the request to the API===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|&amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|location&lt;br /&gt;
|&amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|note_private&lt;br /&gt;
|&amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Configuration of the data returned by the API===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the action in a “Zap”==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Trigger setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Action Setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
|Event name&lt;br /&gt;
|Summary&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|Location&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Validate and publish the integration=&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Go further=&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56533</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56533"/>
		<updated>2023-05-14T19:32:40Z</updated>

		<summary type="html">&lt;p&gt;IPazu: fixing bundle and some minor changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Integration of Dolibarr to the Zapier automation platform=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Preamble==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: &lt;br /&gt;
&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) &lt;br /&gt;
* You have access to a user account with administrator rights &lt;br /&gt;
* You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) &lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Zapier integration=&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin. You will be asked for different information: &lt;br /&gt;
&lt;br /&gt;
* A name for your integration &lt;br /&gt;
* A description &lt;br /&gt;
* A website URL &lt;br /&gt;
* A logo &lt;br /&gt;
* The audience targeted by your integration (public or private) &lt;br /&gt;
* Your role in the development of the integration (employee, hired, independent)&lt;br /&gt;
* The category of your integration&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring Authentication Fields==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Password&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the token exchange request==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: Configuring the test request==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: {{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}}) which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the connection==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index&amp;lt;/code&amp;gt; endpoint. &amp;lt;code&amp;gt;php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create a trigger=&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action=&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
*&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring the action==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Create&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Noun&lt;br /&gt;
|&amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Visibility Options&lt;br /&gt;
|Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the fields==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Label&lt;br /&gt;
!Key&lt;br /&gt;
!Type&lt;br /&gt;
!Required&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|&amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|&amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
|Text&lt;br /&gt;
|❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: API configuration==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===API request configuration===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Testing the request to the API===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|&amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|location&lt;br /&gt;
|&amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|note_private&lt;br /&gt;
|&amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Configuration of the data returned by the API===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the action in a “Zap”==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Trigger setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Action Setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
|Event name&lt;br /&gt;
|Summary&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|Location&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Validate and publish the integration=&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Go further=&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Licence=&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56532</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56532"/>
		<updated>2023-05-14T19:29:09Z</updated>

		<summary type="html">&lt;p&gt;IPazu: fixing list format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Integration of Dolibarr to the Zapier automation platform=&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Preamble==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: &lt;br /&gt;
&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) &lt;br /&gt;
* You have access to a user account with administrator rights &lt;br /&gt;
* You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) &lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create the Zapier integration=&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin. You will be asked for different information: &lt;br /&gt;
&lt;br /&gt;
* A name for your integration &lt;br /&gt;
* A description &lt;br /&gt;
* A website URL &lt;br /&gt;
* A logo &lt;br /&gt;
* The audience targeted by your integration (public or private) &lt;br /&gt;
* Your role in the development of the integration (employee, hired, independent)&lt;br /&gt;
* The category of your integration&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Configure authentication=&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring Authentication Fields==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|String&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Field Type&lt;br /&gt;
|&amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|&amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Required&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Password&lt;br /&gt;
|-&lt;br /&gt;
|Help Text&lt;br /&gt;
|&amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the token exchange request==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: Configuring the test request==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;code&amp;gt;{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}})&amp;lt;/code&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the connection==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index endpoint. php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create a trigger=&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Create an action=&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
*&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 1: Configuring the action==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Create&lt;br /&gt;
|-&lt;br /&gt;
|Key&lt;br /&gt;
|&amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Noun&lt;br /&gt;
|&amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Visibility Options&lt;br /&gt;
|Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 2: Configuring the fields==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Label&lt;br /&gt;
!Key&lt;br /&gt;
!Type&lt;br /&gt;
!Required&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|&amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|&amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|&amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
|DateTime&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|&amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
|String&lt;br /&gt;
|❌ No&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|&amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
|&amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
|Text&lt;br /&gt;
|❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 3: API configuration==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===API request configuration===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Testing the request to the API===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|label&lt;br /&gt;
|&amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datep&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|datef&lt;br /&gt;
|&amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|location&lt;br /&gt;
|&amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|note_private&lt;br /&gt;
|&amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Configuration of the data returned by the API===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==Step 4: Testing the action in a “Zap”==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Trigger setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===Action Setup===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Field&lt;br /&gt;
!Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
|Event name&lt;br /&gt;
|Summary&lt;br /&gt;
|-&lt;br /&gt;
|Start date&lt;br /&gt;
|Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|End date&lt;br /&gt;
|Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
|Location&lt;br /&gt;
|Location&lt;br /&gt;
|-&lt;br /&gt;
|Description&lt;br /&gt;
|Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Validate and publish the integration=&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Go further=&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Credits=&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=Licence=&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56531</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56531"/>
		<updated>2023-05-14T19:28:14Z</updated>

		<summary type="html">&lt;p&gt;IPazu: fixing bundle and lists&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Preamble ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Zapier integration =&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin.&lt;br /&gt;
&lt;br /&gt;
You will be asked for different information: * a name for your integration * a description * a website URL * a logo * the audience targeted by your integration (public or private) * your role in the development of the integration (employee, hired, independent) * the category of your integration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring Authentication Fields ==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| String&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Password&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the token exchange request ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: Configuring the test request ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: {{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}}) which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the connection ==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index&amp;lt;/code&amp;gt; endpoint. &amp;lt;code&amp;gt;php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create a trigger =&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
* &#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring the action ==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Create&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Noun&lt;br /&gt;
| &amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Visibility Options&lt;br /&gt;
| Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the fields ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Label&lt;br /&gt;
! Key&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| &amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| &amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
| Text&lt;br /&gt;
| ❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: API configuration ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== API request configuration ===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing the request to the API ===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| &amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| location&lt;br /&gt;
| &amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| note_private&lt;br /&gt;
| &amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuration of the data returned by the API ===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the action in a “Zap” ==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Trigger setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Action Setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
| Event name&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| Location&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Validate and publish the integration =&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Go further =&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56529</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56529"/>
		<updated>2023-05-14T19:06:24Z</updated>

		<summary type="html">&lt;p&gt;IPazu: IPazu moved page Integration of Dolibarr to the make automation platform to Integration of Dolibarr to the Make automation platform&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-make-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Make automation platform =&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-make-application&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Make application =&lt;br /&gt;
&lt;br /&gt;
# Go to https://eu1.make.com and log into your user account&lt;br /&gt;
# Go to the &amp;lt;code&amp;gt;My Apps&amp;lt;/code&amp;gt; tab&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Create a new app&amp;lt;/code&amp;gt;. You can call it &amp;lt;code&amp;gt;Dolibarr&amp;lt;/code&amp;gt;. This instance will contain a connection and several modules that will implement specific features such as &#039;&#039;&#039;creation of a task&#039;&#039;&#039; or &#039;&#039;&#039;creation of an event&#039;&#039;&#039; for instance.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Base&amp;lt;/code&amp;gt; tab, you just have to write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab and &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NB : The applications that a user can create on Make are written in &amp;lt;code&amp;gt;json&amp;lt;/code&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== a) &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
There are three required parameters for the connection : the &#039;&#039;Dolibarr API key&#039;&#039;, the &#039;&#039;URL of the Dolibarr instance&#039;&#039; (&amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt; for instance) and your &#039;&#039;user ID&#039;&#039;. It means these parameters require some values in order to create a connection. Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== b) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;log&amp;quot;: {&lt;br /&gt;
        &amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action-module&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action module =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-module-to-create-events-in-the-dolibarr-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of module to create events in the Dolibarr calendar ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case : &amp;amp;gt;“As soon as you receive a mail on an Email box, report it in Dolibarr events”&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call &amp;lt;code&amp;gt;Creation of an event&amp;lt;/code&amp;gt;. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
        &amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
        &amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
        &amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation of the different required fields :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| Event type&lt;br /&gt;
| text&lt;br /&gt;
| Email reception&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Event label&lt;br /&gt;
| text&lt;br /&gt;
| New emails received&lt;br /&gt;
|-&lt;br /&gt;
| type_code&lt;br /&gt;
| Dolibarr event type code&lt;br /&gt;
| number&lt;br /&gt;
| &#039;&#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| userownerid&lt;br /&gt;
| Dolibarr user that create the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| email_sender&lt;br /&gt;
| Login of the sender&lt;br /&gt;
| text&lt;br /&gt;
| jdoe&lt;br /&gt;
|-&lt;br /&gt;
| email_from&lt;br /&gt;
| Email address of the sender&lt;br /&gt;
| text&lt;br /&gt;
| john@doe.org&lt;br /&gt;
|-&lt;br /&gt;
| status&lt;br /&gt;
|&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| percentage&lt;br /&gt;
| Event progress&lt;br /&gt;
| number between -1 (N/A) and 100&lt;br /&gt;
| -1&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| Start date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| End date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The type_code “6” corresponds to the event type “Email reception”.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
        &amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;st-scenario-report-an-email-in-dolibarr-events&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 1st scenario : Report an email in Dolibarr events ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;email-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Email scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-email-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Email scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Email&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch Emails&amp;lt;/code&amp;gt; trigger of this module. To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-email-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Email module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, choose the &#039;&#039;&#039;connection&#039;&#039;&#039; : select the IMAP connection that you configured (named &#039;&#039;My others IMAP connection&#039;&#039;)&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;/INBOX&amp;lt;/code&amp;gt; &#039;&#039;&#039;folder&#039;&#039;&#039;&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Only unread mails&amp;lt;/code&amp;gt; &#039;&#039;&#039;criteria&#039;&#039;&#039;&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mark message(s) as read when fetched&amp;lt;/code&amp;gt; unless you want to mark messages as read.&lt;br /&gt;
# Don’t forget to click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt; at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt; action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below :&lt;br /&gt;
&lt;br /&gt;
# Select the right &#039;&#039;&#039;connection&#039;&#039;&#039;&lt;br /&gt;
# Select the &#039;&#039;&#039;Email address&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Address&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Name&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Name&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Mail label&#039;&#039;&#039; with &amp;lt;code&amp;gt;&amp;amp;quot;1. Sender Email Name&amp;amp;quot; : &amp;amp;quot;1. Subject&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Received on&#039;&#039;&#039; field : &amp;lt;code&amp;gt;1.Date&amp;lt;/code&amp;gt;&lt;br /&gt;
# Choose the &#039;&#039;&#039;Type&#039;&#039;&#039; : 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;7&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-a-module-implementation-to-create-a-project-task-on-dolibarr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of a module implementation to create a project task on Dolibarr ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“Creation of a project task in Dolibarr once an issue is created on Github”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (&amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; tab, &amp;lt;code&amp;gt;Tasks/Activities&amp;lt;/code&amp;gt; section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module &amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Required fields :&#039;&#039;&#039; There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the &amp;lt;code&amp;gt;Task list&amp;lt;/code&amp;gt; columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| ref&lt;br /&gt;
| Task reference&lt;br /&gt;
| text&lt;br /&gt;
| K2304-0005&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Task label&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| fk_project&lt;br /&gt;
| Project reference&lt;br /&gt;
| number&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| date_start&lt;br /&gt;
| Start date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_end&lt;br /&gt;
| End date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation&lt;br /&gt;
| date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| user_creation&lt;br /&gt;
| User that created the task&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| planned_workload&lt;br /&gt;
| Estimated completion time (in seconds)&lt;br /&gt;
| number&lt;br /&gt;
| 8400&lt;br /&gt;
|-&lt;br /&gt;
| duration_effective&lt;br /&gt;
| Percentage of actual progress&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| fk_user_creat&lt;br /&gt;
| ID of the user that created the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| progress&lt;br /&gt;
| Progress of the project (in %)&lt;br /&gt;
| number between 0 and 100&lt;br /&gt;
| 50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting up the Github OAuth connection :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Add button&amp;lt;/code&amp;gt; next to the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; field. Select the &#039;&#039;&#039;Connection type&#039;&#039;&#039; as OAuth.&lt;br /&gt;
# Optional: In the &#039;&#039;&#039;Connection name&#039;&#039;&#039; field, enter a name for the connection.&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Save&amp;lt;/code&amp;gt;.&lt;br /&gt;
# a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }   &lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;nd-scenario-create-a-task-in-dolibarr-when-a-new-issue-is-created-on-github&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 2nd scenario : Create a task in Dolibarr when a new issue is created on Github ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;github-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Github scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-github-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Github scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Github&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch issues&amp;lt;/code&amp;gt; trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-github-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Github module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
# Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the &#039;&#039;&#039;I want to watch&#039;&#039;&#039; field.&lt;br /&gt;
# Select the repository from which we want to launch the scenario on the &#039;&#039;&#039;repository&#039;&#039;&#039; field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
# Choose the &#039;&#039;&#039;maximum number of returned issues&#039;&#039;&#039; : 10 for example&lt;br /&gt;
# Fill the &#039;&#039;&#039;watch&#039;&#039;&#039; field : select &amp;lt;code&amp;gt;only new issues&amp;lt;/code&amp;gt;&lt;br /&gt;
# Then, select the &#039;&#039;&#039;filter&#039;&#039;&#039; : &amp;lt;code&amp;gt;all issues&amp;lt;/code&amp;gt;(for example)&lt;br /&gt;
# Finally, select the &#039;&#039;&#039;state&#039;&#039;&#039; : &amp;lt;code&amp;gt;only opened issues&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Task created by&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Creator&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Name of task&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Title&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of creation&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of start&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Project ID&#039;&#039;&#039; : &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of end&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date updated&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;rd-scenario-create-a-new-event-in-the-dolibarr-calendar-when-creating-one-in-google-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar ==&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; among the several propositions. After, in the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; section, add a connection with your Google account and accept the terms. In the &amp;lt;code&amp;gt;Calendar&amp;lt;/code&amp;gt; section, choose your calendar account. Then, in the &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Event name&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Summary&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Start time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Start&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;End time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. End&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Location&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Description&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Description&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Email adress&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Organizer: Email&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;help-for-developpers&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Help for developpers =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-the-code-on-vscode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Viewing the code on VSCode ==&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the &amp;lt;code&amp;gt;Make Apps SDK&amp;lt;/code&amp;gt; extension. More details can be found on the [https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code extension configuration page].&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56527</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56527"/>
		<updated>2023-05-14T19:06:02Z</updated>

		<summary type="html">&lt;p&gt;IPazu: IPazu moved page Integration of Dolibarr to the zapier automation platform to Integration of Dolibarr to the Zapier automation platform&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Zapier automation platform =&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Preamble ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Zapier integration =&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin.&lt;br /&gt;
&lt;br /&gt;
You will be asked for different information: * a name for your integration * a description * a website URL * a logo * the audience targeted by your integration (public or private) * your role in the development of the integration (employee, hired, independent) * the category of your integration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring Authentication Fields ==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| String&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Password&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the token exchange request ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: Configuring the test request ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;code&amp;gt;{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}})&amp;lt;/code&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the connection ==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index endpoint. php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create a trigger =&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
* &#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring the action ==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Create&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Noun&lt;br /&gt;
| &amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Visibility Options&lt;br /&gt;
| Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the fields ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Label&lt;br /&gt;
! Key&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| &amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| &amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
| Text&lt;br /&gt;
| ❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: API configuration ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== API request configuration ===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing the request to the API ===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| &amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| location&lt;br /&gt;
| &amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| note_private&lt;br /&gt;
| &amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuration of the data returned by the API ===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the action in a “Zap” ==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Trigger setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Action Setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
| Event name&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| Location&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Validate and publish the integration =&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Go further =&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56524</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56524"/>
		<updated>2023-05-14T10:19:39Z</updated>

		<summary type="html">&lt;p&gt;IPazu: fixing license&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-make-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Make automation platform =&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-make-application&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Make application =&lt;br /&gt;
&lt;br /&gt;
# Go to https://eu1.make.com and log into your user account&lt;br /&gt;
# Go to the &amp;lt;code&amp;gt;My Apps&amp;lt;/code&amp;gt; tab&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Create a new app&amp;lt;/code&amp;gt;. You can call it &amp;lt;code&amp;gt;Dolibarr&amp;lt;/code&amp;gt;. This instance will contain a connection and several modules that will implement specific features such as &#039;&#039;&#039;creation of a task&#039;&#039;&#039; or &#039;&#039;&#039;creation of an event&#039;&#039;&#039; for instance.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Base&amp;lt;/code&amp;gt; tab, you just have to write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab and &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NB : The applications that a user can create on Make are written in &amp;lt;code&amp;gt;json&amp;lt;/code&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== a) &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
There are three required parameters for the connection : the &#039;&#039;Dolibarr API key&#039;&#039;, the &#039;&#039;URL of the Dolibarr instance&#039;&#039; (&amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt; for instance) and your &#039;&#039;user ID&#039;&#039;. It means these parameters require some values in order to create a connection. Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== b) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;log&amp;quot;: {&lt;br /&gt;
        &amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action-module&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action module =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-module-to-create-events-in-the-dolibarr-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of module to create events in the Dolibarr calendar ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case : &amp;amp;gt;“As soon as you receive a mail on an Email box, report it in Dolibarr events”&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call &amp;lt;code&amp;gt;Creation of an event&amp;lt;/code&amp;gt;. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
        &amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
        &amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
        &amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation of the different required fields :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| Event type&lt;br /&gt;
| text&lt;br /&gt;
| Email reception&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Event label&lt;br /&gt;
| text&lt;br /&gt;
| New emails received&lt;br /&gt;
|-&lt;br /&gt;
| type_code&lt;br /&gt;
| Dolibarr event type code&lt;br /&gt;
| number&lt;br /&gt;
| &#039;&#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| userownerid&lt;br /&gt;
| Dolibarr user that create the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| email_sender&lt;br /&gt;
| Login of the sender&lt;br /&gt;
| text&lt;br /&gt;
| jdoe&lt;br /&gt;
|-&lt;br /&gt;
| email_from&lt;br /&gt;
| Email address of the sender&lt;br /&gt;
| text&lt;br /&gt;
| john@doe.org&lt;br /&gt;
|-&lt;br /&gt;
| status&lt;br /&gt;
|&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| percentage&lt;br /&gt;
| Event progress&lt;br /&gt;
| number between -1 (N/A) and 100&lt;br /&gt;
| -1&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| Start date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| End date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The type_code “6” corresponds to the event type “Email reception”.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
        &amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;st-scenario-report-an-email-in-dolibarr-events&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 1st scenario : Report an email in Dolibarr events ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;email-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Email scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-email-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Email scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Email&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch Emails&amp;lt;/code&amp;gt; trigger of this module. To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-email-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Email module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, choose the &#039;&#039;&#039;connection&#039;&#039;&#039; : select the IMAP connection that you configured (named &#039;&#039;My others IMAP connection&#039;&#039;)&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;/INBOX&amp;lt;/code&amp;gt; &#039;&#039;&#039;folder&#039;&#039;&#039;&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Only unread mails&amp;lt;/code&amp;gt; &#039;&#039;&#039;criteria&#039;&#039;&#039;&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mark message(s) as read when fetched&amp;lt;/code&amp;gt; unless you want to mark messages as read.&lt;br /&gt;
# Don’t forget to click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt; at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt; action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below :&lt;br /&gt;
&lt;br /&gt;
# Select the right &#039;&#039;&#039;connection&#039;&#039;&#039;&lt;br /&gt;
# Select the &#039;&#039;&#039;Email address&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Address&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Name&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Name&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Mail label&#039;&#039;&#039; with &amp;lt;code&amp;gt;&amp;amp;quot;1. Sender Email Name&amp;amp;quot; : &amp;amp;quot;1. Subject&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Received on&#039;&#039;&#039; field : &amp;lt;code&amp;gt;1.Date&amp;lt;/code&amp;gt;&lt;br /&gt;
# Choose the &#039;&#039;&#039;Type&#039;&#039;&#039; : 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;7&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-a-module-implementation-to-create-a-project-task-on-dolibarr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of a module implementation to create a project task on Dolibarr ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“Creation of a project task in Dolibarr once an issue is created on Github”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (&amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; tab, &amp;lt;code&amp;gt;Tasks/Activities&amp;lt;/code&amp;gt; section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module &amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Required fields :&#039;&#039;&#039; There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the &amp;lt;code&amp;gt;Task list&amp;lt;/code&amp;gt; columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| ref&lt;br /&gt;
| Task reference&lt;br /&gt;
| text&lt;br /&gt;
| K2304-0005&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Task label&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| fk_project&lt;br /&gt;
| Project reference&lt;br /&gt;
| number&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| date_start&lt;br /&gt;
| Start date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_end&lt;br /&gt;
| End date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation&lt;br /&gt;
| date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| user_creation&lt;br /&gt;
| User that created the task&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| planned_workload&lt;br /&gt;
| Estimated completion time (in seconds)&lt;br /&gt;
| number&lt;br /&gt;
| 8400&lt;br /&gt;
|-&lt;br /&gt;
| duration_effective&lt;br /&gt;
| Percentage of actual progress&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| fk_user_creat&lt;br /&gt;
| ID of the user that created the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| progress&lt;br /&gt;
| Progress of the project (in %)&lt;br /&gt;
| number between 0 and 100&lt;br /&gt;
| 50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting up the Github OAuth connection :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Add button&amp;lt;/code&amp;gt; next to the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; field. Select the &#039;&#039;&#039;Connection type&#039;&#039;&#039; as OAuth.&lt;br /&gt;
# Optional: In the &#039;&#039;&#039;Connection name&#039;&#039;&#039; field, enter a name for the connection.&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Save&amp;lt;/code&amp;gt;.&lt;br /&gt;
# a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }   &lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;nd-scenario-create-a-task-in-dolibarr-when-a-new-issue-is-created-on-github&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 2nd scenario : Create a task in Dolibarr when a new issue is created on Github ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;github-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Github scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-github-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Github scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Github&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch issues&amp;lt;/code&amp;gt; trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-github-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Github module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
# Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the &#039;&#039;&#039;I want to watch&#039;&#039;&#039; field.&lt;br /&gt;
# Select the repository from which we want to launch the scenario on the &#039;&#039;&#039;repository&#039;&#039;&#039; field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
# Choose the &#039;&#039;&#039;maximum number of returned issues&#039;&#039;&#039; : 10 for example&lt;br /&gt;
# Fill the &#039;&#039;&#039;watch&#039;&#039;&#039; field : select &amp;lt;code&amp;gt;only new issues&amp;lt;/code&amp;gt;&lt;br /&gt;
# Then, select the &#039;&#039;&#039;filter&#039;&#039;&#039; : &amp;lt;code&amp;gt;all issues&amp;lt;/code&amp;gt;(for example)&lt;br /&gt;
# Finally, select the &#039;&#039;&#039;state&#039;&#039;&#039; : &amp;lt;code&amp;gt;only opened issues&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Task created by&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Creator&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Name of task&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Title&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of creation&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of start&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Project ID&#039;&#039;&#039; : &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of end&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date updated&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;rd-scenario-create-a-new-event-in-the-dolibarr-calendar-when-creating-one-in-google-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar ==&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; among the several propositions. After, in the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; section, add a connection with your Google account and accept the terms. In the &amp;lt;code&amp;gt;Calendar&amp;lt;/code&amp;gt; section, choose your calendar account. Then, in the &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Event name&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Summary&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Start time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Start&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;End time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. End&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Location&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Description&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Description&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Email adress&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Organizer: Email&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;help-for-developpers&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Help for developpers =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-the-code-on-vscode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Viewing the code on VSCode ==&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the &amp;lt;code&amp;gt;Make Apps SDK&amp;lt;/code&amp;gt; extension. More details can be found on the [https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code extension configuration page].&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56523</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56523"/>
		<updated>2023-05-14T10:19:05Z</updated>

		<summary type="html">&lt;p&gt;IPazu: Fixing images and structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-make-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Make automation platform =&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-make-application&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Make application =&lt;br /&gt;
&lt;br /&gt;
# Go to https://eu1.make.com and log into your user account&lt;br /&gt;
# Go to the &amp;lt;code&amp;gt;My Apps&amp;lt;/code&amp;gt; tab&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Create a new app&amp;lt;/code&amp;gt;. You can call it &amp;lt;code&amp;gt;Dolibarr&amp;lt;/code&amp;gt;. This instance will contain a connection and several modules that will implement specific features such as &#039;&#039;&#039;creation of a task&#039;&#039;&#039; or &#039;&#039;&#039;creation of an event&#039;&#039;&#039; for instance.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Base&amp;lt;/code&amp;gt; tab, you just have to write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab and &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NB : The applications that a user can create on Make are written in &amp;lt;code&amp;gt;json&amp;lt;/code&amp;gt;.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== a) &amp;lt;code&amp;gt;Parameters&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
There are three required parameters for the connection : the &#039;&#039;Dolibarr API key&#039;&#039;, the &#039;&#039;URL of the Dolibarr instance&#039;&#039; (&amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt; for instance) and your &#039;&#039;user ID&#039;&#039;. It means these parameters require some values in order to create a connection. Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== b) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ==&lt;br /&gt;
&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;log&amp;quot;: {&lt;br /&gt;
        &amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action-module&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action module =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-module-to-create-events-in-the-dolibarr-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of module to create events in the Dolibarr calendar ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case : &amp;amp;gt;“As soon as you receive a mail on an Email box, report it in Dolibarr events”&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call &amp;lt;code&amp;gt;Creation of an event&amp;lt;/code&amp;gt;. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
        &amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
        &amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
        &amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
        &amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
        &amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation of the different required fields :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| Event type&lt;br /&gt;
| text&lt;br /&gt;
| Email reception&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Event label&lt;br /&gt;
| text&lt;br /&gt;
| New emails received&lt;br /&gt;
|-&lt;br /&gt;
| type_code&lt;br /&gt;
| Dolibarr event type code&lt;br /&gt;
| number&lt;br /&gt;
| &#039;&#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| userownerid&lt;br /&gt;
| Dolibarr user that create the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| email_sender&lt;br /&gt;
| Login of the sender&lt;br /&gt;
| text&lt;br /&gt;
| jdoe&lt;br /&gt;
|-&lt;br /&gt;
| email_from&lt;br /&gt;
| Email address of the sender&lt;br /&gt;
| text&lt;br /&gt;
| john@doe.org&lt;br /&gt;
|-&lt;br /&gt;
| status&lt;br /&gt;
|&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| percentage&lt;br /&gt;
| Event progress&lt;br /&gt;
| number between -1 (N/A) and 100&lt;br /&gt;
| -1&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| Start date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| End date of the event&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The type_code “6” corresponds to the event type “Email reception”.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
        &amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save the written code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;st-scenario-report-an-email-in-dolibarr-events&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 1st scenario : Report an email in Dolibarr events ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;email-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Email scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-email-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Email scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Email&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch Emails&amp;lt;/code&amp;gt; trigger of this module. To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-email-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Email module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, choose the &#039;&#039;&#039;connection&#039;&#039;&#039; : select the IMAP connection that you configured (named &#039;&#039;My others IMAP connection&#039;&#039;)&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;/INBOX&amp;lt;/code&amp;gt; &#039;&#039;&#039;folder&#039;&#039;&#039;&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Only unread mails&amp;lt;/code&amp;gt; &#039;&#039;&#039;criteria&#039;&#039;&#039;&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;No&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mark message(s) as read when fetched&amp;lt;/code&amp;gt; unless you want to mark messages as read.&lt;br /&gt;
# Don’t forget to click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt; at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt; action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below :&lt;br /&gt;
&lt;br /&gt;
# Select the right &#039;&#039;&#039;connection&#039;&#039;&#039;&lt;br /&gt;
# Select the &#039;&#039;&#039;Email address&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Address&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Name&#039;&#039;&#039; with &amp;lt;code&amp;gt;1. Sender Email Name&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Mail label&#039;&#039;&#039; with &amp;lt;code&amp;gt;&amp;amp;quot;1. Sender Email Name&amp;amp;quot; : &amp;amp;quot;1. Subject&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Select the &#039;&#039;&#039;Received on&#039;&#039;&#039; field : &amp;lt;code&amp;gt;1.Date&amp;lt;/code&amp;gt;&lt;br /&gt;
# Choose the &#039;&#039;&#039;Type&#039;&#039;&#039; : 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;ol start=&amp;quot;7&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-of-a-module-implementation-to-create-a-project-task-on-dolibarr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Example of a module implementation to create a project task on Dolibarr ==&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;“Creation of a project task in Dolibarr once an issue is created on Github”&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (&amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; tab, &amp;lt;code&amp;gt;Tasks/Activities&amp;lt;/code&amp;gt; section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module &amp;lt;code&amp;gt;Projects&amp;lt;/code&amp;gt; of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Required fields :&#039;&#039;&#039; There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the &amp;lt;code&amp;gt;Task list&amp;lt;/code&amp;gt; columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! API field&lt;br /&gt;
! Description&lt;br /&gt;
! Type&lt;br /&gt;
! Possible value&lt;br /&gt;
|-&lt;br /&gt;
| ref&lt;br /&gt;
| Task reference&lt;br /&gt;
| text&lt;br /&gt;
| K2304-0005&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| Task label&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| fk_project&lt;br /&gt;
| Project reference&lt;br /&gt;
| number&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| date_start&lt;br /&gt;
| Start date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_end&lt;br /&gt;
| End date&lt;br /&gt;
| date&lt;br /&gt;
| 2023-03-12T18:25:43-05:00&lt;br /&gt;
|-&lt;br /&gt;
| date_creation&lt;br /&gt;
| Date of creation&lt;br /&gt;
| date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| user_creation&lt;br /&gt;
| User that created the task&lt;br /&gt;
| text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| planned_workload&lt;br /&gt;
| Estimated completion time (in seconds)&lt;br /&gt;
| number&lt;br /&gt;
| 8400&lt;br /&gt;
|-&lt;br /&gt;
| duration_effective&lt;br /&gt;
| Percentage of actual progress&lt;br /&gt;
| number&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| fk_user_creat&lt;br /&gt;
| ID of the user that created the event&lt;br /&gt;
| number&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| progress&lt;br /&gt;
| Progress of the project (in %)&lt;br /&gt;
| number between 0 and 100&lt;br /&gt;
| 50&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-communication-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== a) &amp;lt;code&amp;gt;Communication&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
    &amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
    &amp;quot;qs&amp;quot;: {},&lt;br /&gt;
    &amp;quot;body&amp;quot;: {&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
        &amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
        &amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;headers&amp;quot;: {&lt;br /&gt;
        &amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;response&amp;quot;: {&lt;br /&gt;
        &amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setting up the Github OAuth connection :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Add button&amp;lt;/code&amp;gt; next to the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; field. Select the &#039;&#039;&#039;Connection type&#039;&#039;&#039; as OAuth.&lt;br /&gt;
# Optional: In the &#039;&#039;&#039;Connection name&#039;&#039;&#039; field, enter a name for the connection.&lt;br /&gt;
# Click on &amp;lt;code&amp;gt;Save&amp;lt;/code&amp;gt;.&lt;br /&gt;
# a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select a connection :&#039;&#039;&#039; Under the previous code block, you have to select a connection. Select the &amp;lt;code&amp;gt;Dolibarr connection&amp;lt;/code&amp;gt; that you created previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-static-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== b) &amp;lt;code&amp;gt;Static parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;    {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-mappable-parameters-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== c) &amp;lt;code&amp;gt;Mappable parameters&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
        &amp;quot;required&amp;quot;: true&lt;br /&gt;
    }   &lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;d-interface-tab-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== d) &amp;lt;code&amp;gt;Interface&amp;lt;/code&amp;gt; tab ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;[&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
        &amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
        &amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
NB : In each tab, save your code with &amp;lt;code&amp;gt;Ctrl+S&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;nd-scenario-create-a-task-in-dolibarr-when-a-new-issue-is-created-on-github&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 2nd scenario : Create a task in Dolibarr when a new issue is created on Github ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-new-scenario-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 1) Create a new scenario ===&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Scenarios&amp;lt;/code&amp;gt; tab of the left-hand menu&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;Create a new scenario&amp;lt;/code&amp;gt; button at the top right&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;github-scenario-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== 2) Github scenario configuration ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;a-github-scenario-initialization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.a) Github scenario initialization ====&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; symbol to add a module&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Github&amp;lt;/code&amp;gt; module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
# Select the &amp;lt;code&amp;gt;Watch issues&amp;lt;/code&amp;gt; trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;b-github-module-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.b) Github module configuration ====&lt;br /&gt;
&lt;br /&gt;
# First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
# Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the &#039;&#039;&#039;I want to watch&#039;&#039;&#039; field.&lt;br /&gt;
# Select the repository from which we want to launch the scenario on the &#039;&#039;&#039;repository&#039;&#039;&#039; field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
# Choose the &#039;&#039;&#039;maximum number of returned issues&#039;&#039;&#039; : 10 for example&lt;br /&gt;
# Fill the &#039;&#039;&#039;watch&#039;&#039;&#039; field : select &amp;lt;code&amp;gt;only new issues&amp;lt;/code&amp;gt;&lt;br /&gt;
# Then, select the &#039;&#039;&#039;filter&#039;&#039;&#039; : &amp;lt;code&amp;gt;all issues&amp;lt;/code&amp;gt;(for example)&lt;br /&gt;
# Finally, select the &#039;&#039;&#039;state&#039;&#039;&#039; : &amp;lt;code&amp;gt;only opened issues&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;c-dolibarr-module-configuration-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== 2.c) Dolibarr module configuration ====&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Task created by&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Creator&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Name of task&#039;&#039;&#039; : &amp;lt;code&amp;gt;1.Title&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of creation&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of start&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date created&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Project ID&#039;&#039;&#039; : &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Date of end&#039;&#039;&#039; : &amp;lt;code&amp;gt;Date updated&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Click on &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;rd-scenario-create-a-new-event-in-the-dolibarr-calendar-when-creating-one-in-google-calendar&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== 3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar ==&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; among the several propositions. After, in the &amp;lt;code&amp;gt;Connection&amp;lt;/code&amp;gt; section, add a connection with your Google account and accept the terms. In the &amp;lt;code&amp;gt;Calendar&amp;lt;/code&amp;gt; section, choose your calendar account. Then, in the &amp;lt;code&amp;gt;Watch Events&amp;lt;/code&amp;gt; section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Event name&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Summary&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Start time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Start&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;End time&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. End&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Location&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Location&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Description&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Description&amp;lt;/code&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Email adress&#039;&#039;&#039; : &amp;lt;code&amp;gt;1. Organizer: Email&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The scenario can now be executed. For this, click on the &amp;lt;code&amp;gt;Run&amp;lt;/code&amp;gt; button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;help-for-developpers&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Help for developpers =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;viewing-the-code-on-vscode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Viewing the code on VSCode ==&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the &amp;lt;code&amp;gt;Make Apps SDK&amp;lt;/code&amp;gt; extension. More details can be found on the [https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code extension configuration page].&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[http://creativecommons.org/licenses/by-sa/4.0/ [[File:https://licensebuttons.net/l/by-sa/4.0/88x31.png|CC BY-SA 4.0]]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56522</id>
		<title>Integration of Dolibarr to the Make automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Make_automation_platform&amp;diff=56522"/>
		<updated>2023-05-14T10:14:51Z</updated>

		<summary type="html">&lt;p&gt;IPazu: Adding make integration documention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;# Integration of Dolibarr to the Make automation platform&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to create a Make integration for Dolibarr using an integration that creates events in the agenda module as an example.&lt;br /&gt;
&lt;br /&gt;
## Prerequisites&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites:&lt;br /&gt;
* You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol)&lt;br /&gt;
* You have access to a user account with administrator rights&lt;br /&gt;
* You have activated the &amp;quot;Web Services API REST&amp;quot; module (if it is not already the case, follow the [official documentation](https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer)))&lt;br /&gt;
* You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: `https://yourdolibarrurl`. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
# Create the Make application&lt;br /&gt;
&lt;br /&gt;
1. Go to &amp;lt;https://eu1.make.com&amp;gt; and log into your user account&lt;br /&gt;
2. Go to the `My Apps` tab&lt;br /&gt;
3. Click on `Create a new app`. You can call it `Dolibarr`. This instance will contain a connection and several modules that will implement specific features such as **creation of a task** or **creation of an event** for instance.&lt;br /&gt;
&lt;br /&gt;
In the `Base` tab, you just have to write&lt;br /&gt;
```json&lt;br /&gt;
{}&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
# Configure authentication&lt;br /&gt;
&lt;br /&gt;
It is essential to link the Make application (i.e Dolibarr) to the external application via a connection, which can be set in the `connection` tab of the Make application.&lt;br /&gt;
&lt;br /&gt;
This tab has two sub-tabs : `Parameters` tab and `Communication` tab.&lt;br /&gt;
&lt;br /&gt;
*NB : The applications that a user can create on Make are written in `json`.*&lt;br /&gt;
&lt;br /&gt;
## a) `Parameters` tab&lt;br /&gt;
There are three required parameters for the connection : the *Dolibarr API key*, the *URL of the Dolibarr instance* (`https://yourdolibarrurl` for instance) and your *user ID*. It means these parameters require some values in order to create a connection.  Thus, you can write the following code :&lt;br /&gt;
&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;apiKey&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Dolibarr API key&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;hostname&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Dolibarr instance URL&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;userownerid&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;number&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save the written code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
## b) `Communication` tab&lt;br /&gt;
The following code specifies the account validation process.&lt;br /&gt;
```json&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;url&amp;quot;:&amp;quot;{{parameters.hostname}}/api/index.php/users/info&amp;quot;,&lt;br /&gt;
&amp;quot;headers&amp;quot;: {&lt;br /&gt;
&amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{parameters.apiKey}}&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;quot;log&amp;quot;: {&lt;br /&gt;
&amp;quot;sanitize&amp;quot;: [&amp;quot;request.headers.DOLAPIKEY&amp;quot;]&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save the written code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
# Create an action module&lt;br /&gt;
## Example of module to create events in the Dolibarr calendar&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&amp;gt;&amp;quot;As soon as you receive a mail on an Email box, report it in Dolibarr events&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from the Email application. In this case, the Email application is a trigger generating an action in Dolibarr.&lt;br /&gt;
&lt;br /&gt;
On the Dolibarr side, the module to implement is an action module, that we can call `Creation of an event`. This module can be configured in different tabs which are detailed below. The different tabs are connected so that some parameters can be used in a tab that is different from itself.&lt;br /&gt;
&lt;br /&gt;
### a) `Communication` tab&lt;br /&gt;
This tab contains the different required parameters that will be transmitted from the Email application to Dolibarr. The required parameters are the one required by the API.&lt;br /&gt;
&lt;br /&gt;
You have to fill the code block of this tab as follows :&lt;br /&gt;
```json&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/agendaevents&amp;quot;,&lt;br /&gt;
&amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
&amp;quot;qs&amp;quot;: {},&lt;br /&gt;
&amp;quot;body&amp;quot;: {&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;Email reception&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;{{parameters.label}}&amp;quot;,&lt;br /&gt;
&amp;quot;type_code&amp;quot;: 6,&lt;br /&gt;
&amp;quot;userownerid&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
&amp;quot;email_sender&amp;quot;: &amp;quot;{{parameters.name}}&amp;quot;,&lt;br /&gt;
&amp;quot;email_from&amp;quot;: &amp;quot;{{lower(parameters.email)}}&amp;quot;,&lt;br /&gt;
&amp;quot;percentage&amp;quot;: &amp;quot;-1&amp;quot;,&lt;br /&gt;
&amp;quot;status&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
&amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
&amp;quot;datep&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;,&lt;br /&gt;
&amp;quot;datef&amp;quot;: &amp;quot;{{parameters.date}}&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;quot;headers&amp;quot;: {&lt;br /&gt;
&amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;quot;response&amp;quot;: {&lt;br /&gt;
&amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save your code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
**Explanation of the different required fields :**&lt;br /&gt;
&lt;br /&gt;
| API field     | Description                         | Type                            | Possible value            |&lt;br /&gt;
|---------------|-------------------------------------|---------------------------------|---------------------------|&lt;br /&gt;
| type          | Event type                          | text                            | Email reception           |&lt;br /&gt;
| label         | Event label                         | text                            | New emails received       |&lt;br /&gt;
| type_code     | Dolibarr event type code            | number                          | **6**                     |&lt;br /&gt;
| userownerid   | Dolibarr user that create the event | number                          | 7                         |&lt;br /&gt;
| email_sender  | Login of the sender                 | text                            | jdoe                      |&lt;br /&gt;
| email_from    | Email address of the sender         | text                            | john@doe.org              |&lt;br /&gt;
| status        |                                     | number                          | 0                         |&lt;br /&gt;
| percentage    | Event progress                      | number between -1 (N/A) and 100 | -1                        |&lt;br /&gt;
| date_creation | Date of creation of the event       | date                            | 2023-03-12T18:25:43-05:00 |&lt;br /&gt;
| datep         | Start date of the event             | date                            | 2023-03-12T18:25:43-05:00 |&lt;br /&gt;
| datef         | End date of the event               | date                            | 2023-03-12T18:25:43-05:00 |&lt;br /&gt;
&lt;br /&gt;
The type_code &amp;quot;6&amp;quot; corresponds to the event type &amp;quot;Email reception&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
NB : Bold parameters are compulsory for this scenario&lt;br /&gt;
&lt;br /&gt;
**Select a connection :**&lt;br /&gt;
Under the previous code block, you have to select a connection. Select the `Dolibarr connection` that you created previously.&lt;br /&gt;
&lt;br /&gt;
### b) `Static parameters` tab&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;type&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
&amp;quot;value&amp;quot;: &amp;quot;Email reception&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save the written code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
### c) `Mappable parameters` tab&lt;br /&gt;
The following parameters are mappable, that means it must be completed by the user.&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;email&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Email address&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;name&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Name&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;:&amp;quot;label&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;:&amp;quot;Mail label&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;:&amp;quot;date&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;:&amp;quot;Received on&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save the written code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
### d) `Interface` tab&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save the written code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
Your integration is now ready to be used.&lt;br /&gt;
&lt;br /&gt;
## 1st scenario : Report an email in Dolibarr events&lt;br /&gt;
&lt;br /&gt;
### 1) Create a new scenario&lt;br /&gt;
&lt;br /&gt;
1) Click on the `Scenarios` tab of the left-hand menu&lt;br /&gt;
2) Click on the `Create a new scenario` button at the top right&lt;br /&gt;
&lt;br /&gt;
### 2) Email scenario configuration&lt;br /&gt;
#### 2.a) Email scenario initialization&lt;br /&gt;
1) Click on the `+` symbol to add a module&lt;br /&gt;
2) Select the `Email` module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
3) Select the `Watch Emails` trigger of this module.&lt;br /&gt;
To set up the Email module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
#### 2.b) Email module configuration&lt;br /&gt;
&lt;br /&gt;
1. First, choose the **connection** : select the IMAP connection that you configured (named *My others IMAP connection*)&lt;br /&gt;
2. Select the `/INBOX` **folder**&lt;br /&gt;
3. Select the `Only unread mails` **criteria**&lt;br /&gt;
4. Click on `No`  for `Mark message(s) as read when fetched` unless you want to mark messages as read.&lt;br /&gt;
5. Don&#039;t forget to click on `OK` at the bottom right of the window.&lt;br /&gt;
&lt;br /&gt;
#### 2.c) Dolibarr module configuration&lt;br /&gt;
&lt;br /&gt;
Add the Dolibarr application by selecting the `Create an event` action that you created previously.&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
![[File:Make mail.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have your scenario is set up, you should fill the Dolibarr module fields with some Email fields, by following the steps below  :&lt;br /&gt;
&lt;br /&gt;
1. Select the right **connection**&lt;br /&gt;
2. Select the **Email address** with `1. Sender Email Address`&lt;br /&gt;
3. Select the **Name** with `1. Sender Email Name`&lt;br /&gt;
4. Select the **Mail label** with `&amp;quot;1. Sender Email Name&amp;quot; : &amp;quot;1. Subject&amp;quot;`&lt;br /&gt;
5. Select the **Received on** field : `1.Date`&lt;br /&gt;
6. Choose the **Type** : 1&lt;br /&gt;
&lt;br /&gt;
![[File:Email parameters.png|thumb|Make email parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. Click on `OK`&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the `Run` button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Example of a module implementation to create a project task on Dolibarr&lt;br /&gt;
&lt;br /&gt;
As a reminder, the goal is to implement the following use case :&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;quot;Creation of a project task in Dolibarr once an issue is created on Github&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In this case, the Dolibarr instance receives information from Github. Github is a trigger that generates an action in Dolibarr, of creating a project task (`Projects` tab, `Tasks/Activities` section).&lt;br /&gt;
&lt;br /&gt;
Here is the code that must be implemented on Make, to realize the scenario of creation of a project task in the module `Projects` of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
**Required fields :**&lt;br /&gt;
There are two types of required fields, the ones which are required to create a valid task that can be accepted by Dolibarr and the fields that give information in the tasks list.&lt;br /&gt;
&lt;br /&gt;
Fields corresponding to the `Task list` columns : task reference, task label, start date (type : date), end date (type : date), project reference, project status, expected workload, time consumed, consumption progress, actual progress declared (percentage), task progress&lt;br /&gt;
&lt;br /&gt;
Mapping between API fields and their labels :&lt;br /&gt;
&lt;br /&gt;
| API field          | Description                            | Type                     | Possible value            |&lt;br /&gt;
|--------------------|----------------------------------------|--------------------------|---------------------------|&lt;br /&gt;
| ref                | Task reference                         | text                     | K2304-0005                |&lt;br /&gt;
| label              | Task label                             | text                     |                           |&lt;br /&gt;
| fk_project         | Project reference                      | number                   | 2                         |&lt;br /&gt;
| date_start         | Start date                             | date                     | 2023-03-12T18:25:43-05:00 |&lt;br /&gt;
| date_end           | End date                               | date                     | 2023-03-12T18:25:43-05:00 |&lt;br /&gt;
| date_creation      | Date of creation                       | date                     |                           |&lt;br /&gt;
| user_creation      | User that created the task             | text                     |                           |&lt;br /&gt;
| planned_workload   | Estimated completion time (in seconds) | number                   | 8400                      |&lt;br /&gt;
| duration_effective | Percentage of actual progress          | number                   | 0                         |&lt;br /&gt;
| fk_user_creat      | ID of the user that created the event  | number                   | 7                         |&lt;br /&gt;
| progress           | Progress of the project (in %)         | number between 0 and 100 | 50                        |&lt;br /&gt;
&lt;br /&gt;
Complete the following tabs as follows :&lt;br /&gt;
&lt;br /&gt;
### a) `Communication` tab&lt;br /&gt;
&lt;br /&gt;
```json&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;url&amp;quot;: &amp;quot;{{connection.hostname}}/api/index.php/tasks&amp;quot;,&lt;br /&gt;
&amp;quot;method&amp;quot;: &amp;quot;POST&amp;quot;,&lt;br /&gt;
&amp;quot;qs&amp;quot;: {},&lt;br /&gt;
&amp;quot;body&amp;quot;: {&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;{{parameters.taskName}}&amp;quot;,&lt;br /&gt;
&amp;quot;fk_project&amp;quot;: &amp;quot;{{parameters.projectID}}&amp;quot;,&lt;br /&gt;
&amp;quot;date_start&amp;quot;: &amp;quot;{{parameters.date_start)}}&amp;quot;,&lt;br /&gt;
&amp;quot;date_end&amp;quot;: &amp;quot;{{parameters.date_end)}}&amp;quot;,&lt;br /&gt;
&amp;quot;user_creation&amp;quot;: &amp;quot;{{parameters.creator)}}&amp;quot;,&lt;br /&gt;
&amp;quot;date_creation&amp;quot;: &amp;quot;{{parameters.date_creation)}}&amp;quot;,&lt;br /&gt;
&amp;quot;fk_user_creat&amp;quot;: &amp;quot;{{connection.userownerid}}&amp;quot;,&lt;br /&gt;
&amp;quot;ref&amp;quot;: &amp;quot;{{parameters.taskref}}&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;quot;headers&amp;quot;: {&lt;br /&gt;
&amp;quot;DOLAPIKEY&amp;quot;: &amp;quot;{{connection.apiKey}}&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
&amp;quot;response&amp;quot;: {&lt;br /&gt;
&amp;quot;output&amp;quot;: &amp;quot;{{body}}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save your code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
**Setting up the Github OAuth connection :**&lt;br /&gt;
&lt;br /&gt;
(Source : https://www.make.com/en/help/app/github?_ga=2.85846297.1242178067.1682759655-390117518.1678356777)&lt;br /&gt;
&lt;br /&gt;
1) Click the `Add button` next to the `Connection` field. Select the **Connection type** as OAuth.&lt;br /&gt;
2)  Optional: In the **Connection name** field, enter a name for the connection.&lt;br /&gt;
3) Click on `Save`.&lt;br /&gt;
4) a Github window should open. Confirm the access by clicking Authorize.&lt;br /&gt;
&lt;br /&gt;
**NB : You may have to reauthorize the connection to avoid some problems. On Make, in the left-side bar menu, select Connection. in the list of the connections, you may find (my Others IMAP connection). Click on Reauthorize.**&lt;br /&gt;
&lt;br /&gt;
**Select a connection :**&lt;br /&gt;
Under the previous code block, you have to select a connection. Select the `Dolibarr connection` that you created previously.&lt;br /&gt;
&lt;br /&gt;
### b) `Static parameters` tab&lt;br /&gt;
&lt;br /&gt;
```json&lt;br /&gt;
{}&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save your code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### c) `Mappable parameters` tab&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;creator&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Task created by:&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;taskName&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Name of task&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;date_creation&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Date of creation&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;date_start&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Date of start&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;projectID&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Project ID&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;date_end&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;date&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Date of end&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;taskref&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;text&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;Reference of task&amp;quot;,&lt;br /&gt;
&amp;quot;required&amp;quot;: true&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save your code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
### d) `Interface` tab&lt;br /&gt;
```json&lt;br /&gt;
[&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;name&amp;quot;: &amp;quot;id&amp;quot;,&lt;br /&gt;
&amp;quot;type&amp;quot;: &amp;quot;uinteger&amp;quot;,&lt;br /&gt;
&amp;quot;label&amp;quot;: &amp;quot;User ID&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
```&lt;br /&gt;
NB : In each tab, save your code with `Ctrl+S`&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
## 2nd scenario : Create a task in Dolibarr when a new issue is created on Github&lt;br /&gt;
&lt;br /&gt;
### 1) Create a new scenario&lt;br /&gt;
&lt;br /&gt;
1) Click on the `Scenarios` tab of the left-hand menu&lt;br /&gt;
2) Click on the `Create a new scenario` button at the top right&lt;br /&gt;
&lt;br /&gt;
### 2) Github scenario configuration&lt;br /&gt;
#### 2.a) Github scenario initialization&lt;br /&gt;
1) Click on the `+` symbol to add a module&lt;br /&gt;
2) Select the `Github` module, that you can search it at the bottom of the drop-down list.&lt;br /&gt;
3) Select the `Watch issues` trigger of this module.&lt;br /&gt;
&lt;br /&gt;
To set up the Github module, you should click on it. A configuration window will appear.&lt;br /&gt;
&lt;br /&gt;
#### 2.b) Github module configuration&lt;br /&gt;
&lt;br /&gt;
1) First, you will need to associate the Github account from which you want to retrieve the issues created, through an OAuth connection.&lt;br /&gt;
2) Then, you should choose if you want to watch all the repositories or only one repository of your linked Github account in the **I want to watch** field.&lt;br /&gt;
3) Select the repository from which we want to launch the scenario on the **repository** field. All the repositories of the Github account will be displayed in a drop-down list.&lt;br /&gt;
&lt;br /&gt;
4) Choose the **maximum number of returned issues** : 10 for example&lt;br /&gt;
5) Fill the **watch** field : select `only new issues`&lt;br /&gt;
6) Then, select the **filter** : `all issues `(for example)&lt;br /&gt;
7) Finally, select the **state** : `only opened issues`&lt;br /&gt;
&lt;br /&gt;
In the end, your screen should look like this :&lt;br /&gt;
&lt;br /&gt;
[[File:Make github.png|thumb]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#### 2.c) Dolibarr module configuration&lt;br /&gt;
&lt;br /&gt;
Once your scenario is set up, you should fill the Dolibarr module fields with the available Github fields :&lt;br /&gt;
&lt;br /&gt;
1) **Task created by** : `1.Creator`&lt;br /&gt;
2) **Name of task** : `1.Title`&lt;br /&gt;
3) **Date of creation** : `Date created`&lt;br /&gt;
4) **Date of start** : `Date created`&lt;br /&gt;
5) **Project ID** : `1`&lt;br /&gt;
6) **Date of end** : `Date updated`&lt;br /&gt;
&lt;br /&gt;
In the end, the window should look like :&lt;br /&gt;
&lt;br /&gt;
[[File:Make github parameters.png|thumb|Make github parameters]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click on `OK`.&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the `Run` button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
## 3rd scenario : Create a new event in the Dolibarr calendar when creating one in Google Calendar&lt;br /&gt;
&lt;br /&gt;
This scenario involves to automatically add a new event in the Dolibarr calendar when creating one in Google Calendar.&lt;br /&gt;
&lt;br /&gt;
First, when creating your scenario on Make, you need to find the Google Calendar application in the list. Then select `Watch Events` among the several propositions. After, in the `Connection` section, add a connection with your Google account and accept the terms. In the `Calendar` section, choose your calendar account. Then, in the `Watch Events` section, select what interest you in particular. Finally, let the other sections by default.&lt;br /&gt;
&lt;br /&gt;
Secondly, add the Dolibarr module at the right of the Google Calendar one, and fill its sections as follows :&lt;br /&gt;
&lt;br /&gt;
* **Event name** : `1. Summary`&lt;br /&gt;
* **Start time** : `1. Start`&lt;br /&gt;
* **End time** : `1. End`&lt;br /&gt;
* **Location** : `1. Location`&lt;br /&gt;
* **Description** : `1. Description`&lt;br /&gt;
* **Email adress** : `1. Organizer: Email`&lt;br /&gt;
&lt;br /&gt;
You normally have the sections filled as follows :&lt;br /&gt;
&lt;br /&gt;
[[File:Create event dolibarr module.png|thumb|Dolibarr module sections]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scenario can now be executed. For this, click on the `Run` button at the bottom left of the screen.&lt;br /&gt;
&lt;br /&gt;
# Help for developpers&lt;br /&gt;
&lt;br /&gt;
## Viewing the code on VSCode&lt;br /&gt;
&lt;br /&gt;
To view the code written on the Make website on VScode, it is possible to install the `Make Apps SDK` extension. More details can be found on the [extension configuration page](https://docs.integromat.com/apps/apps-sdk/configuration-of-vs-code).&lt;br /&gt;
&lt;br /&gt;
NB: The code viewed under VScode is stored in a local temporary repository on your computer, and it is synchronized with the code visible on Make.&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is only possible to export the code in .zip, which is annoying to put it on a Github repository for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Credits&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [AuTEAMation](https://github.com/AuTEAMation) team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [DoliCloud ](https://www.dolicloud.com/). This study was carried out as part of the PFA, a 2nd year group project at [ENSEIRB-MATMECA](https://enseirb-matmeca.bordeaux-inp.fr).&lt;br /&gt;
&lt;br /&gt;
# Licence&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a&lt;br /&gt;
[Creative Commons Attribution-ShareAlike 4.0 International License][cc-by-sa].&lt;br /&gt;
&lt;br /&gt;
[![CC BY-SA 4.0][cc-by-sa-image]][cc-by-sa]&lt;br /&gt;
&lt;br /&gt;
[cc-by-sa]: http://creativecommons.org/licenses/by-sa/4.0/&lt;br /&gt;
[cc-by-sa-image]: https://licensebuttons.net/l/by-sa/4.0/88x31.png&lt;br /&gt;
[cc-by-sa-shield]: https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Make_github.png&amp;diff=56521</id>
		<title>File:Make github.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Make_github.png&amp;diff=56521"/>
		<updated>2023-05-14T10:12:49Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Make github&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Create_event_dolibarr_module.png&amp;diff=56520</id>
		<title>File:Create event dolibarr module.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Create_event_dolibarr_module.png&amp;diff=56520"/>
		<updated>2023-05-14T10:12:23Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dolibarr module sections&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Make_github_parameters.png&amp;diff=56519</id>
		<title>File:Make github parameters.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Make_github_parameters.png&amp;diff=56519"/>
		<updated>2023-05-14T10:11:39Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Make github parameters&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Email_parameters.png&amp;diff=56518</id>
		<title>File:Email parameters.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Email_parameters.png&amp;diff=56518"/>
		<updated>2023-05-14T10:11:07Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Make email parameters&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Make_mail.png&amp;diff=56517</id>
		<title>File:Make mail.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Make_mail.png&amp;diff=56517"/>
		<updated>2023-05-14T10:10:36Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Make mail&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56516</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56516"/>
		<updated>2023-05-14T10:05:20Z</updated>

		<summary type="html">&lt;p&gt;IPazu: Fixing code files and licence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Zapier automation platform =&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Preamble ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Zapier integration =&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin.&lt;br /&gt;
&lt;br /&gt;
You will be asked for different information: * a name for your integration * a description * a website URL * a logo * the audience targeted by your integration (public or private) * your role in the development of the integration (employee, hired, independent) * the category of your integration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring Authentication Fields ==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| String&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Password&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the token exchange request ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: Configuring the test request ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;code&amp;gt;{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}})&amp;lt;/code&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the connection ==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index endpoint. php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/authentication.js code/authentication.js], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create a trigger =&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
* &#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring the action ==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Create&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Noun&lt;br /&gt;
| &amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Visibility Options&lt;br /&gt;
| Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the fields ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Label&lt;br /&gt;
! Key&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| &amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| &amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
| Text&lt;br /&gt;
| ❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: API configuration ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== API request configuration ===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing the request to the API ===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| &amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| location&lt;br /&gt;
| &amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| note_private&lt;br /&gt;
| &amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuration of the data returned by the API ===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the action in a “Zap” ==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Trigger setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Action Setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
| Event name&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| Location&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [https://github.com/Dolibarr/dolibarr-integration-resources/blob/main/zapier/code/creates/create_event.js code/creates/create_event.js], exported from Zapier CLI. Similarly, you will find other sample actions in the [https://github.com/Dolibarr/dolibarr-integration-resources/tree/main/zapier/code/creates code/creates] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Validate and publish the integration =&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Go further =&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[https://creativecommons.org/licenses/by-sa/4.0/ License CC-BY-SA 4.0]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56515</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56515"/>
		<updated>2023-05-14T09:56:52Z</updated>

		<summary type="html">&lt;p&gt;IPazu: Fixing images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Zapier automation platform =&lt;br /&gt;
&lt;br /&gt;
[http://creativecommons.org/licenses/by-sa/4.0/ [[File:https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg|CC BY-SA 4.0]]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Preamble ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Zapier integration =&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin.&lt;br /&gt;
&lt;br /&gt;
You will be asked for different information: * a name for your integration * a description * a website URL * a logo * the audience targeted by your integration (public or private) * your role in the development of the integration (employee, hired, independent) * the category of your integration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:01-new-integration.png|thumb|Form in the zapier interface when adding the dolibarr integration]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring Authentication Fields ==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| String&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Password&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the token exchange request ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: Configuring the test request ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;code&amp;gt;{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}})&amp;lt;/code&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the connection ==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:02-authentication-test.png|thumb|Testing dolibarr connection in zapier]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index endpoint. php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [[./code/authentication.js|code/authentication.js]], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create a trigger =&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
* &#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring the action ==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Create&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Noun&lt;br /&gt;
| &amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Visibility Options&lt;br /&gt;
| Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the fields ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Label&lt;br /&gt;
! Key&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| &amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| &amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
| Text&lt;br /&gt;
| ❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:03-create-event-input-designer.png|thumb|Example of action for dolibar in Zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: API configuration ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== API request configuration ===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing the request to the API ===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| &amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| location&lt;br /&gt;
| &amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| note_private&lt;br /&gt;
| &amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuration of the data returned by the API ===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the action in a “Zap” ==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Trigger setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Action Setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
| Event name&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| Location&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:04-test-zap.png|thumb|Testing actions created for dolibarr in zapier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [[./code/creates/create_event.js|code/creates/create_event.js]], exported from Zapier CLI. Similarly, you will find other sample actions in the [[./code/creates|code/creates]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Validate and publish the integration =&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Go further =&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[http://creativecommons.org/licenses/by-sa/4.0/ [[File:https://licensebuttons.net/l/by-sa/4.0/88x31.png|CC BY-SA 4.0]]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:04-test-zap.png&amp;diff=56514</id>
		<title>File:04-test-zap.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:04-test-zap.png&amp;diff=56514"/>
		<updated>2023-05-14T09:51:41Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Testing actions created in zapier for dolibarr&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:03-create-event-input-designer.png&amp;diff=56513</id>
		<title>File:03-create-event-input-designer.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:03-create-event-input-designer.png&amp;diff=56513"/>
		<updated>2023-05-14T09:50:09Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of action for dolibarr in zapier&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:02-authentication-test.png&amp;diff=56512</id>
		<title>File:02-authentication-test.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:02-authentication-test.png&amp;diff=56512"/>
		<updated>2023-05-14T09:48:00Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Testing dolibarr conection in zapier&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:01-new-integration.png&amp;diff=56511</id>
		<title>File:01-new-integration.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:01-new-integration.png&amp;diff=56511"/>
		<updated>2023-05-14T09:46:36Z</updated>

		<summary type="html">&lt;p&gt;IPazu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adding dolibarr integration in zapier interface&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56510</id>
		<title>Integration of Dolibarr to the Zapier automation platform</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Integration_of_Dolibarr_to_the_Zapier_automation_platform&amp;diff=56510"/>
		<updated>2023-05-14T09:39:43Z</updated>

		<summary type="html">&lt;p&gt;IPazu: Adding zapier doc for dolibarr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;integration-of-dolibarr-to-the-zapier-automation-platform&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Integration of Dolibarr to the Zapier automation platform =&lt;br /&gt;
&lt;br /&gt;
[http://creativecommons.org/licenses/by-sa/4.0/ [[File:https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg|CC BY-SA 4.0]]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;preamble&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Preamble ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to create an integration for Zapier: using the Zapier CLI or using the Zapier Platform Visual Builder. By starting to create an integration with the Zapier Platform Visual Builder, you can then export your integration and import it into the Zapier CLI for editing and publishing. But once you start using the Zapier CLI, you will no longer be able to use the Zapier Platform Visual Builder to modify your integration. In this tutorial, we will start by using the Zapier Platform Visual Builder, but the project was exported in the Zapier CLI and you can find it in the [[./code|code]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;prerequisites&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
The following tutorial assumes that you have completed the following prerequisites: * You have access to an instance of Dolibarr configured to use SSL encryption (with the HTTPS protocol) * You have access to a user account with administrator rights * You have activated the “Web Services API REST” module (if it is not already the case, follow the [https://wiki.dolibarr.org/index.php/Module_Web_Services_API_REST_(developer) official documentation]) * You have obtained an API key for your user account that you will use to test your integration (generated by an administrator, or by the user himself if he has permission to modify his user account information)&lt;br /&gt;
&lt;br /&gt;
When necessary, we will use the following URL to refer to your Dolibarr instance: &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;. You will have to replace it with the URL of your own Dolibarr instance, without trailing slash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-the-zapier-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create the Zapier integration =&lt;br /&gt;
&lt;br /&gt;
Start by accessing the Zapier Platform Visual Builder at the following address: https://developer.zapier.com/.&lt;br /&gt;
&lt;br /&gt;
If you don’t already have a Zapier account, you’ll need to create one. Once logged in, you should land on the Zapier Platform Visual Builder home page. Click the “Start a Zapier Integration” button to begin.&lt;br /&gt;
&lt;br /&gt;
You will be asked for different information: * a name for your integration * a description * a website URL * a logo * the audience targeted by your integration (public or private) * your role in the development of the integration (employee, hired, independent) * the category of your integration&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:./screenshots/01-new-integration.png|Integration creation form]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
You can find more information on the [https://platform.zapier.com/quickstart/create-integration official documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;configure-authentication&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Configure authentication =&lt;br /&gt;
&lt;br /&gt;
Once you’ve created your integration, you’ll land on its dashboard. In the “Authentication” section, click on the “Set Up Authentication” button.&lt;br /&gt;
&lt;br /&gt;
You will be offered several authentication methods (API Key, OAuth v2, Session Auth, Basic Auth, Digest Auth…). In our case, we will use the “Session Auth” method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Although the “API Key” method seems to correspond better to the use of the Dolibarr API (since it requires an API key), the connection data is fixed and would require the user specifies its user ID in the Dolibarr database upstream, so that it can then be used in other actions. With the “Session Auth” method, we simply retrieve the user’s identifier at the first connection, which can then be used in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-authentication-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring Authentication Fields ==&lt;br /&gt;
&lt;br /&gt;
In the first step, click on the “Add Field” button to add a first field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;Instance URL&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| String&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the base address of the Dolibarr instance, it must not have &amp;amp;quot;/&amp;amp;quot; at the end and must start with https://.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
Then add a second field with the following information:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Field Type&lt;br /&gt;
| &amp;lt;code&amp;gt;Field&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Label&lt;br /&gt;
| &amp;lt;code&amp;gt;API Key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Required&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Password&lt;br /&gt;
|-&lt;br /&gt;
| Help Text&lt;br /&gt;
| &amp;lt;code&amp;gt;Specify the API key associated with the Dolibarr account to use through the integration.&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Leave the other fields blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-token-exchange-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the token exchange request ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the token exchange request. In the case of Dolibarr, there is no notion of token, but we will use this request to retrieve the identifier of the user who connects (see note above) as well as his first and last name (for display in Zapier).&lt;br /&gt;
&lt;br /&gt;
The Zapier interface offers a “simple” mode where all you have to do is enter the URL of the request and the parameters to send, but that is not enough in our case. We will use the “advanced” mode by clicking on the “Switch to Code Mode” button.&lt;br /&gt;
&lt;br /&gt;
Paste the following code in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {&lt;br /&gt;
      &#039;id&#039;: results.id,&lt;br /&gt;
      &#039;firstname&#039;: results.firstname,&lt;br /&gt;
      &#039;lastname&#039;: results.lastname,&lt;br /&gt;
    };&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; From the data that will be entered by the user in the authentication fields (&amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api_key&amp;lt;/code&amp;gt;) and accessible via &amp;lt;code&amp;gt;bundle.authData&amp;lt;/code&amp;gt;, we build the URL of the Dolibarr API, then we make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key. We then retrieve the user’s data (his identifier, first name and last name) and send them back to Zapier to make them available in other actions.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once the code has been pasted, click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-configuring-the-test-request&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: Configuring the test request ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the test query. This request is used by Zapier to verify that the information entered by the user is correct. In our case, we will simply make a GET request on the URL &amp;lt;code&amp;gt;/api/index.php/users/info&amp;lt;/code&amp;gt; with the header &amp;lt;code&amp;gt;DOLAPIKEY&amp;lt;/code&amp;gt; containing the API key.&lt;br /&gt;
&lt;br /&gt;
As before, click on the “Switch to Code Mode” button and paste the following code into it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/users/info`,&lt;br /&gt;
  method: &#039;GET&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will then have to specify a “Connection Label”, which will be displayed to the user when he connects to his Dolibarr account from Zapier. For example, you can use the first and last name of the user, or the name of the Dolibarr instance. By imagining that the user is called “John Doe” and that the Dolibarr instance is available at the address &amp;lt;code&amp;gt;https://yourdolibarrurl&amp;lt;/code&amp;gt;, you can use the following value: &amp;lt;code&amp;gt;{{bundle.authData.firstname}} {{bundle.authData.lastname}}({{bundle.authData.host}})&amp;lt;/code&amp;gt; which will show &amp;lt;code&amp;gt;John Doe (https://yourdolibarrurl)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Save &amp;amp;amp; Continue” button to go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-connection&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the connection ==&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you need to test the connection to Dolibarr. Click on the “Add a New Account” button.&lt;br /&gt;
&lt;br /&gt;
A window will open and ask you to enter the authentication information configured in step 1, i.e. the URL of the Dolibarr instance and the API key of the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:./screenshots/02-authentication-test.png|Authentication information input window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Once the information has been entered, click on the “Yes, Continue to …” button.&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see your account appear in the list of available accounts.&lt;br /&gt;
&lt;br /&gt;
Then click on the “Test Authentication” button to check that the connection is working properly. If everything went well, you should see the result of the test query configured in step 3, i.e. the user information returned by the &amp;lt;code&amp;gt;/api/index endpoint. php/users/info&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: &amp;quot;10&amp;quot;,&lt;br /&gt;
  &amp;quot;login&amp;quot;: &amp;quot;jdoe&amp;quot;,&lt;br /&gt;
  &amp;quot;lastname&amp;quot;: &amp;quot;Doe&amp;quot;,&lt;br /&gt;
  &amp;quot;firstname&amp;quot;: &amp;quot;John&amp;quot;,&lt;br /&gt;
  // And many more...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
All you have to do is click on the “Save &amp;amp;amp; Finish” button to complete the authentication configuration.&lt;br /&gt;
&lt;br /&gt;
The different authentication configuration data is available in the file [[./code/authentication.js|code/authentication.js]], exported from Zapier CLI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-a-trigger&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create a trigger =&lt;br /&gt;
&lt;br /&gt;
Creating a trigger is more complex than creating an action. Indeed, a trigger must be able to retrieve data from an event that occurs in Dolibarr and send it to Zapier.&lt;br /&gt;
&lt;br /&gt;
Dolibarr offers a “webhook” system that allows data to be sent to a given URL when an event occurs, but it is not yet fully adapted to setting up a trigger in Zapier. So we won’t cover in this part in the tutorial, but all contributions about it are welcome.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;create-an-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Create an action =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example case:&#039;&#039;&#039; Create an event in the Dolibarr calendar&lt;br /&gt;
* &#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; Have activated the “Events/Agenda” module in Dolibarr and given the necessary permissions to the user to create an event in his name&lt;br /&gt;
&lt;br /&gt;
Actions allow to perform operations in Dolibarr, in reaction to an event that occurs in another application. For example, you can create an action that allows to create an event in the Dolibarr calendar when an event is created in Google Calendar. It is this use case that we will cover in this part of the tutorial.&lt;br /&gt;
&lt;br /&gt;
From the integration dashboard on Zapier, click on the “Add Action” button in the “Actions” section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-1-configuring-the-action&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 1: Configuring the action ==&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action. To do this, you must give it a name and a description. This information will be displayed to the user when they use the action in a zap. Fill in the fields as follows (you can of course use the values of your choice depending on the action you want to create):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Create&lt;br /&gt;
|-&lt;br /&gt;
| Key&lt;br /&gt;
| &amp;lt;code&amp;gt;create_event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Noun&lt;br /&gt;
| &amp;lt;code&amp;gt;Event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Create an event in the Dolibarr calendar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Visibility Options&lt;br /&gt;
| Important (Displayed above the fold in the Zap Editor)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once the fields are filled in, click on the “Save” button and go to the next step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-2-configuring-the-fields&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 2: Configuring the fields ==&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the action fields. These fields allow the user to enter the information needed to perform the action. In our case, we are going to create an action which allows to create an event in the Dolibarr calendar. We will therefore need the following fields: a name, a start date, an end date, a place and a description. Many other fields are available, but we will limit ourselves to these 5 fields for this example.&lt;br /&gt;
&lt;br /&gt;
Click the “Add” &amp;amp;gt; “Input Field” button to add a field. Fill in the fields as follows, then click the “Save” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Label&lt;br /&gt;
! Key&lt;br /&gt;
! Type&lt;br /&gt;
! Required&lt;br /&gt;
|-&lt;br /&gt;
| Name&lt;br /&gt;
| &amp;lt;code&amp;gt;Event name&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| &amp;lt;code&amp;gt;Start date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datep&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ✅ Yes&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| &amp;lt;code&amp;gt;End date&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;datef&amp;lt;/code&amp;gt;&lt;br /&gt;
| DateTime&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| &amp;lt;code&amp;gt;Location&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt;&lt;br /&gt;
| String&lt;br /&gt;
| ❌ No&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;note_private&amp;lt;/code&amp;gt;&lt;br /&gt;
| Text&lt;br /&gt;
| ❌ No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The field keys are deliberately the same as the keys used by the Dolibarr API to identify the fields. Often poorly documented, they can be found in the source code of Dolibarr, or directly in the database. You can also create a resource from Dolibarr then retrieve it via the API (use the API explorer at https://yourdolibarrurl/api/index.php/explorer/ or a tool like Postman to test the requests to the API) to identify the field keys based on the data you entered.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Once all the fields have been created, you should see a summary table of the action fields and a preview of the data entry form similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:./screenshots/03-create-event-input-designer.png|Summary table of action fields]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-3-api-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 3: API configuration ==&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the request to the Dolibarr API, in three substeps:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;api-request-configuration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== API request configuration ===&lt;br /&gt;
&lt;br /&gt;
In the first sub-step, you need to fill in the basic request information to the API. As for the authentication configuration, switch to “code” mode by clicking on the “Switch to Code Mode” button, then paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;const options = {&lt;br /&gt;
  url: `${bundle.authData.host}/api/index.php/agendaevents`,&lt;br /&gt;
  method: &#039;POST&#039;,&lt;br /&gt;
  headers: {&lt;br /&gt;
    &#039;Content-Type&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;Accept&#039;: &#039;application/json&#039;,&lt;br /&gt;
    &#039;DOLAPIKEY&#039;: bundle.authData.api_key&lt;br /&gt;
  },&lt;br /&gt;
  body: JSON.stringify({&lt;br /&gt;
    &#039;type_id&#039;: &amp;quot;50&amp;quot;,&lt;br /&gt;
    &#039;userownerid&#039;: bundle.authData.id,&lt;br /&gt;
    &#039;label&#039;: bundle.inputData.label,&lt;br /&gt;
    &#039;datep&#039;: Date.parse(bundle.inputData.datep) / 1000,&lt;br /&gt;
    &#039;datef&#039;: Date.parse(bundle.inputData.datef) / 1000,&lt;br /&gt;
    &#039;location&#039;: bundle.inputData.location,&lt;br /&gt;
    &#039;note_private&#039;: bundle.inputData.note_private&lt;br /&gt;
  })&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return z.request(options)&lt;br /&gt;
  .then((response) =&amp;gt; {&lt;br /&gt;
    response.throwForStatus();&lt;br /&gt;
    const results = response.json;&lt;br /&gt;
&lt;br /&gt;
    return {id: results};&lt;br /&gt;
  });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The code above is to be adapted according to the fields you created in the previous step. For strings, you can directly use user-entered values via &amp;lt;code&amp;gt;bundle.inputData&amp;lt;/code&amp;gt;. For dates, you need to use &amp;lt;code&amp;gt;Date.parse()&amp;lt;/code&amp;gt; to convert the date entered by the user into timestamp (in milliseconds in JavaScript), then divide by 1000 to get a timestamp in seconds (Dolibarr API expects a timestamp in seconds). Some fields take “hard” numeric values, such as &amp;lt;code&amp;gt;type_id&amp;lt;/code&amp;gt;, which will then have to be discovered by exploring the Dolibarr API. Finally, for the &amp;lt;code&amp;gt;userownerid&amp;lt;/code&amp;gt; field, we use &amp;lt;code&amp;gt;bundle.authData.id&amp;lt;/code&amp;gt;, which was automatically populated by Zapier with the user ID when the user configured their Dolibarr account in Zapier.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;testing-the-request-to-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Testing the request to the API ===&lt;br /&gt;
&lt;br /&gt;
In the second sub-step, you need to test the request to the API. To do this, choose the Dolibarr account to use (like the one connected when configuring authentication) or add a new one. Then fill in the fields with test values, then click the “Test Your Request” button:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| label&lt;br /&gt;
| &amp;lt;code&amp;gt;Test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datep&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| datef&lt;br /&gt;
| &amp;lt;code&amp;gt;2023-05-01T18:00:00.000Z&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| location&lt;br /&gt;
| &amp;lt;code&amp;gt;Test room&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| note_private&lt;br /&gt;
| &amp;lt;code&amp;gt;This is a test event&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; When testing or creating a “Zap” (user scenario), Zapier only offers text fields, nothing more. For dates, you must therefore enter a date in one of the supported formats ([https://help.zapier.com/hc/en-us/articles/8496259603341#date-time-fields-0-0 see here]), for example in ISO 8601 format (&amp;lt;code&amp;gt;2023-05-01T16:00:00.000Z&amp;lt;/code&amp;gt; for May 1, 2023 at 4:00 PM UTC). When using your action in a workflow, Zapier will also offer data fields from the triggering application, more often suited to the data types you defined in the previous step.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
If everything goes well, you should see a success message and a preview of the data returned by the Dolibarr API, in this case, the identifier of the event created:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;id&amp;quot;: 86&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;configuration-of-the-data-returned-by-the-api&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Configuration of the data returned by the API ===&lt;br /&gt;
&lt;br /&gt;
In the third substep, you need to configure the data returned by the API. This is to tell Zapier what the data returned by the API corresponds to, to then possibly be reused in other scenarios. In our case, we will simply indicate that the identifier of the created event corresponds to the identifier of the event created by the Dolibarr API. To do this, simply click on the “Use Response from Test Data” button, then “Generate Output Field Definitions”. You should then see an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; field appear in the list of output fields, give it the description &amp;lt;code&amp;gt;ID of the event created&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All you have to do is click on the “Save Output &amp;amp;amp; Finish” button to complete the configuration of your action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;step-4-testing-the-action-in-a-zap&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Step 4: Testing the action in a “Zap” ==&lt;br /&gt;
&lt;br /&gt;
Now that your action is configured, you can use it in a “Zap” (user scenario). To do this, go to the [https://zapier.com/app/zaps Zapier user dashboard] and click on the “Create” &amp;amp;gt; “New Zap” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;trigger-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Trigger setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you must configure the “trigger” of your scenario. In our case, we are going to use the “Google Calendar” &amp;amp;gt; “New Event” trigger, which lets you trigger the scenario when a new event is created in a Google Calendar. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Google account to use. Click the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Google Calendar account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the Google Calendar to monitor. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth and last step, you can test the trigger by clicking on the “Test trigger” button. This will look for an event in the selected Google Calendar and use it to test the rest of the scenario. If all goes well, you should see a success message and a preview of the data returned by the trigger. Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;action-setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Action Setup ===&lt;br /&gt;
&lt;br /&gt;
In the first step, you need to configure the action of your scenario. In our case, we are going to use the “Dolibarr” &amp;amp;gt; “Create Event” action, which we created earlier. This will appear with the mention “By invite”, because it is not yet published. If you don’t see it, make sure you’re using the same Zapier account you used to create the action. If you want to use an action created but not published by another Zapier account, you can invite that account to collaborate on your Zapier app (see [https://platform.zapier.com/private_integrations/share-your-private-integration here]). Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the second step, you need to configure the Dolibarr account to use. Click on the “Connect a new account” button (or select an existing account), then follow the instructions to connect your Dolibarr account to Zapier. Once the account is connected, click on the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the third step, you need to configure the data to provide to the action. To do this, you can use the data returned by the trigger, by clicking on a field and selecting the corresponding field in the list of data. In our case, we will use the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Google Calendar field&lt;br /&gt;
|-&lt;br /&gt;
| Event name&lt;br /&gt;
| Summary&lt;br /&gt;
|-&lt;br /&gt;
| Start date&lt;br /&gt;
| Event begins (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| End date&lt;br /&gt;
| Event ends (pretty)&lt;br /&gt;
|-&lt;br /&gt;
| Location&lt;br /&gt;
| Location&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Click the “Continue” button.&lt;br /&gt;
&lt;br /&gt;
In the fourth step, you can test the action by clicking the “Test action” button. This will create an event in Dolibarr, with a copy of the Google Calendar event data. If all goes well, you should see a success message and a preview of the created event ID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:./screenshots/04-test-zap.png|Example of Zap test]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
All you have to do is click on the “Publish” button and “Turn Zap on” to activate your scenario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services like Gmail or Google Drive cannot be used in a Zapier scenario until the integration is published and validated. So you will be able to test your scenario, but when publishing you will get an error message. To work around this problem, you can for example use the “Code by Zapier” &amp;amp;gt; “Run Javascript” action before the Dolibarr action, simply returning the trigger data to make it available in the Dolibarr action. Alternatively, you can publish your integration and have it validated.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
The different action configuration data is available in the file [[./code/creates/create_event.js|code/creates/create_event.js]], exported from Zapier CLI. Similarly, you will find other sample actions in the [[./code/creates|code/creates]] folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;validate-and-publish-the-integration&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Validate and publish the integration =&lt;br /&gt;
&lt;br /&gt;
The final step is to validate and publish the integration. This step is necessary to be able to use the integration with other accounts than the one used to create it without having to invite them to collaborate on the Zapier application.&lt;br /&gt;
&lt;br /&gt;
This part will not be covered in this tutorial, because it requires having the rights to the Dolibarr application or to the domain name of the organization (more information [https://platform.zapier.com/partners/integration-review-guidelines#21-integration-ownership here]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;go-further&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Go further =&lt;br /&gt;
&lt;br /&gt;
Many other features are available in Zapier, such as the “search” actions, which allow you to list data in a third-party application in order to use it in a programmed scenario or executed via an external trigger. As seen above, it is possible to create triggers, but this will probably have to wait for better management of webhooks in Dolibarr. Finally, although Dolibarr already offers many APIs, some features are not yet available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusion&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
Zapier is a very powerful tool that allows you to create integrations between many third-party applications without having to write a single line of code. It also allows to create complex scenarios, using conditions and loops. Finally, it allows creating private integrations, which are not available to other Zapier users, but only to accounts invited to collaborate on the Zapier app. Dolibarr is a very complete application, which already offers many APIs, but which can be further improved. Its integration into Zapier will allow it to be used with many other applications, and to create complex scenarios, without having to write a single line of code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;credits&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
This tutorial was produced by the [https://github.com/AuTEAMation AuTEAMation] team as part of the design of interfacing prototypes between the Dolibarr ERP/CRM and several automation platforms for [https://www.dolicloud.com/ DoliCloud]. This study was carried out as part of the PFA, a 2nd year group project at [https://enseirb-matmeca.bordeaux-inp.fr ENSEIRB-MATMECA].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;licence&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Licence =&lt;br /&gt;
&lt;br /&gt;
This tutorial is licensed under a [http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License].&lt;br /&gt;
&lt;br /&gt;
[http://creativecommons.org/licenses/by-sa/4.0/ [[File:https://licensebuttons.net/l/by-sa/4.0/88x31.png|CC BY-SA 4.0]]]&lt;/div&gt;</summary>
		<author><name>IPazu</name></author>
	</entry>
</feed>