... | ... | @@ -60,17 +60,17 @@ To select (firstname, lastname) record fields of Module for matching email (=[te |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="get">
|
|
|
<select module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname"> </field>
|
|
|
<field name="lastname"> </field>
|
|
|
</record>
|
|
|
<where>
|
|
|
<field name="email" value="[email protected]"> </field>
|
|
|
</where>
|
|
|
<api method="get">
|
|
|
<select module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname"> </field>
|
|
|
<field name="lastname"> </field>
|
|
|
</record>
|
|
|
<where>
|
|
|
<field name="email" value="[email protected]"> </field>
|
|
|
</where>
|
|
|
</select>
|
|
|
</api>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -81,17 +81,23 @@ To select (firstname, lastname) of Contacts record where email field value match |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="get">
|
|
|
<select module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname"> </field>
|
|
|
<field name="lastname"> </field>
|
|
|
</record>
|
|
|
<where>
|
|
|
<field name="email" value="@email_address"> </field>
|
|
|
</where>
|
|
|
<api method="get">
|
|
|
<select module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname"> </field>
|
|
|
<field name="lastname"> </field>
|
|
|
</record>
|
|
|
<where>
|
|
|
<field name="reportsto" module="Contacts">
|
|
|
<select>
|
|
|
<where>
|
|
|
<field name="email" condition="eq" value="@emailaddress"></field>
|
|
|
</where>
|
|
|
</select>
|
|
|
</field>
|
|
|
</where>
|
|
|
</select>
|
|
|
</api>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -104,18 +110,18 @@ If the intent is to create Contacts module record by accepting (firstname, lastn |
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
|
|
|
<api method="post">
|
|
|
<create module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname" value="@firstname"></field>
|
|
|
<field name="lastname" value="@lastname"></field>
|
|
|
<field name="email" value="@email"></field>
|
|
|
</record>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
</return>
|
|
|
</create>
|
|
|
</api>
|
|
|
<api method="post">
|
|
|
<create module="Contacts">
|
|
|
<record>
|
|
|
<field name="firstname" value="@firstname"></field>
|
|
|
<field name="lastname" value="@lastname"></field>
|
|
|
<field name="email" value="@email"></field>
|
|
|
</record>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
</return>
|
|
|
</create>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -127,29 +133,29 @@ Reference field rules can have a combination of select and create rules which gi |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="post">
|
|
|
<create module="Potentials">
|
|
|
<record>
|
|
|
<field name="potentialname" value="@name"></field>
|
|
|
<field name="amount" value="@amount"></field>
|
|
|
<field name="contact_id" module="Contacts">
|
|
|
<select>
|
|
|
<where>
|
|
|
<field name="email" value="@email"></field>
|
|
|
</where>
|
|
|
</select>
|
|
|
<create>
|
|
|
<record>
|
|
|
<field name="lastname" value="@lastname"></field>
|
|
|
<field name="firstname" value="@firstname"></field>
|
|
|
<field name="email" value="@email"></field>
|
|
|
<field name="contacttype" value="Lead"></field>
|
|
|
</record>
|
|
|
</create>
|
|
|
</field>
|
|
|
</record>
|
|
|
</create>
|
|
|
</api>
|
|
|
<api method="post">
|
|
|
<create module="Potentials">
|
|
|
<record>
|
|
|
<field name="potentialname" value="@name"></field>
|
|
|
<field name="amount" value="@amount"></field>
|
|
|
<field name="contact_id" module="Contacts">
|
|
|
<select>
|
|
|
<where>
|
|
|
<field name="email" value="@email"></field>
|
|
|
</where>
|
|
|
</select>
|
|
|
<create>
|
|
|
<record>
|
|
|
<field name="lastname" value="@lastname"></field>
|
|
|
<field name="firstname" value="@firstname"></field>
|
|
|
<field name="email" value="@email"></field>
|
|
|
<field name="contacttype" value="Lead"></field>
|
|
|
</record>
|
|
|
</create>
|
|
|
</field>
|
|
|
</record>
|
|
|
</create>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -161,44 +167,46 @@ To replace email field value with incoming parameter (new_email) on all Contacts |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="put">
|
|
|
<api method="put">
|
|
|
<update module="Contacts">
|
|
|
<record>
|
|
|
<field name="email" value="@new_email"></field>
|
|
|
</record>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
</return>
|
|
|
<where>
|
|
|
<field name="email" condition="eq" value="@old_email"></field>
|
|
|
</where>
|
|
|
<record>
|
|
|
<field name="email" value="@new_email"></field>
|
|
|
</record>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
</return>
|
|
|
<where>
|
|
|
<field name="email" condition="eq" value="@old_email"></field>
|
|
|
</where>
|
|
|
</update>
|
|
|
</api>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### Upsert
|
|
|
|
|
|
You can update and create in one single api
|
|
|
|
|
|
```
|
|
|
<api method="post" module="Contacts">
|
|
|
<upsert>
|
|
|
<where>
|
|
|
<field name="id" condition="eq" value="@CRMID"></field>
|
|
|
</where>
|
|
|
<sort>
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="post" module="Contacts">
|
|
|
<upsert>
|
|
|
<where>
|
|
|
<field name="id" condition="eq" value="@CRMID"></field>
|
|
|
</where>
|
|
|
<sort>
|
|
|
<field name="id" order="desc"></field>
|
|
|
</sort>
|
|
|
<limit max="1"></limit>
|
|
|
<update>
|
|
|
</sort>
|
|
|
<limit max="1"></limit>
|
|
|
<update>
|
|
|
<record>
|
|
|
<field name="email" value="@email" presence="optional"></field>
|
|
|
<field name="cardnumber" value="@card" presence="optional"></field>
|
|
|
</record>
|
|
|
</update>
|
|
|
<create>
|
|
|
<record>
|
|
|
</update>
|
|
|
<create>
|
|
|
<record>
|
|
|
<field name="firstname" value="@firstname" presence="optional"></field>
|
|
|
<field name="lastname" value="@lastname" presence="optional"></field>
|
|
|
<field name="email" value="@email" presence="optional"></field>
|
... | ... | @@ -213,14 +221,14 @@ To replace email field value with incoming parameter (new_email) on all Contacts |
|
|
</select>
|
|
|
</field>
|
|
|
</record>
|
|
|
</create>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
<field name="lastname"></field>
|
|
|
<field name="account_id"></field>
|
|
|
</return>
|
|
|
</upsert>
|
|
|
</api>
|
|
|
</create>
|
|
|
<return>
|
|
|
<field name="id"></field>
|
|
|
<field name="lastname"></field>
|
|
|
<field name="account_id"></field>
|
|
|
</return>
|
|
|
</upsert>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -232,14 +240,14 @@ Using bearer token invoke Google Sheet API |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="get">
|
|
|
<api method="get">
|
|
|
<rest>
|
|
|
<url>https://sheets.googleapis.com/v4/spreadsheets/sheetID</url>
|
|
|
<auth>
|
|
|
<bearer token="@token" />
|
|
|
</auth>
|
|
|
<url sheetID="@sheetid">https://sheets.googleapis.com/v4/spreadsheets/$sheetID</url>
|
|
|
<auth>
|
|
|
<bearer token="@token" />
|
|
|
</auth>
|
|
|
</rest>
|
|
|
</api>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | @@ -305,17 +313,17 @@ Example: |
|
|
|
|
|
```
|
|
|
<?xml version="1.0" ?>
|
|
|
<api method="post">
|
|
|
<rest method="post">
|
|
|
<url SHEETID="@sheetid" OPTIONS="values/Sheet1!A1:append?valueInputOption=RAW">https://sheets.googleapis.com/v4/spreadsheets/$SHEETID/$OPTIONS</url>
|
|
|
<auth>
|
|
|
<oauth type="vtap" service="Google" module="CUSTOM_MODULE"> </oauth>
|
|
|
</auth>
|
|
|
<parameters raw-post-data="true">
|
|
|
<parameter name='values' value='@row_data' presence="optional"></parameter>
|
|
|
</parameters>
|
|
|
<api method="post">
|
|
|
<rest method="post">
|
|
|
<url SHEETID="@sheetid" OPTIONS="values/Sheet1!A1:append?valueInputOption=RAW">https://sheets.googleapis.com/v4/spreadsheets/$SHEETID/$OPTIONS</url>
|
|
|
<auth>
|
|
|
<oauth type="vtap" service="Google" module="CUSTOM_MODULE"> </oauth>
|
|
|
</auth>
|
|
|
<parameters raw-post-data="true">
|
|
|
<parameter name='values' value='@row_data' presence="optional"></parameter>
|
|
|
</parameters>
|
|
|
</rest>
|
|
|
</api>
|
|
|
</api>
|
|
|
```
|
|
|
|
|
|
|
... | ... | |