diff --git a/dev/examples/zapier/triggers/action.js b/dev/examples/zapier/triggers/action.js index 0e152473869..86e4b747185 100644 --- a/dev/examples/zapier/triggers/action.js +++ b/dev/examples/zapier/triggers/action.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -84,7 +84,7 @@ const getFallbackRealAction = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/actions', +// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/actions', // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js index 2ba3bd226f8..ef83970e0b5 100644 --- a/dev/examples/zapier/triggers/contact.js +++ b/dev/examples/zapier/triggers/contact.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealContact = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -94,7 +94,7 @@ const getFallbackRealContact = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/member.js b/dev/examples/zapier/triggers/member.js index 3385cdca625..68f80b30009 100644 --- a/dev/examples/zapier/triggers/member.js +++ b/dev/examples/zapier/triggers/member.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealMember = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -94,7 +94,7 @@ const getFallbackRealMember = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/order.js b/dev/examples/zapier/triggers/order.js index 061ce218d10..2265c4da288 100644 --- a/dev/examples/zapier/triggers/order.js +++ b/dev/examples/zapier/triggers/order.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -74,7 +74,7 @@ const getFallbackRealOrder = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/orders', +// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/orders', // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 76194acbc9a..6c477b1174f 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -83,7 +83,7 @@ const getFallbackRealThirdparty = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -102,7 +102,7 @@ const getFallbackRealThirdparty = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/ticket.js b/dev/examples/zapier/triggers/ticket.js index c642099bd55..ee5a3f8efd7 100644 --- a/dev/examples/zapier/triggers/ticket.js +++ b/dev/examples/zapier/triggers/ticket.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealTicket = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -97,7 +97,7 @@ const getFallbackRealTicket = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/user.js b/dev/examples/zapier/triggers/user.js index 92209bb8651..a706bb9a3d6 100644 --- a/dev/examples/zapier/triggers/user.js +++ b/dev/examples/zapier/triggers/user.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -73,7 +73,7 @@ const getFallbackRealUser = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -93,7 +93,7 @@ const getFallbackRealUser = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index f065a165a54..56ab923435d 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/zapier/class/hook.class.php'; * @access protected * @class DolibarrApiAccess {@requires user,external} */ -class ZapierApi extends DolibarrApi +class Zapier extends DolibarrApi { /** * @var array $FIELDS Mandatory fields, checked when create and update object