Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Introduction
The connector package is a zip file containing configuration files related to Custom Connectors. These configuration files have their own specific formats. The document describes the content of Connector Package and the formats of the configuration files to be placed in package zip.
Content of Connector Package
The connector package zip contains below files:
- Image file for Connector.
- XML and JSON Layouts for Trigger and Action entities.
- Triggers And Actions Text file.
- Lookup configuration file.
Follow the below steps to create Connector Package.
Identify the Entities for Connector
Refer the Connector documentation to know about the entities available in it. For example, for a CRM App the entities can be Lead, Contact, or Customer etc.
Make a list of entities and endpoints that you want to integrate with.
Make a list of attributes (fields) for each entity.
Create XML and JSON Layout files for each entity
For each entity
Create EntityResponse.xml file and EntityResponse.json file.
Create EntityRequest.xml file and EntityRequest.json file. For example, for entity Lead create LeadResponse.xml and LeadRequest.xml files.
Edit the above created xml and JSON files in Text editor.
Paste the below sample XML in xml file.
Code Block language xml title Entity Layout collapse true <Root> </Root>
Add the entity name as a tag in this xml file. For example, for entity Lead see below xml.
Code Block language xml title Entity Layout <Root> <leads> </leads> </Root>
Enter the attributes of this entity as individual elements in the xml, and save the file.
Code Block language xml title Entity Layout collapse true <Root> <leads> <id/> <first_name/> <last_name/> <created_at/> </leads> </Root>
Paste below json into JSON file.
Code Block language js title Entity Layout collapse true { "fieldName": "Root", "expanded": true, "leaf": false, "children": [] }
Add the entity name as children in this json file. For example, for entity Lead see below json.
Code Block language js title Entity Layout collapse true { "fieldName": "Root", "expanded": true, "leaf": false, "children": [{ "fieldName": "leads", "expanded": true, "isAttribute": false, "leaf": false, "value": "\n\t", "children": [] }] }
Enter the attributes of this entity as individual elements in this json file, and save the file.
Code Block language js title Entity Layout collapse true { "fieldName": "Root", "expanded": true, "leaf": false, "children": [{ "fieldName": "leads", "expanded": true, "isAttribute": false, "leaf": false, "value": "\n\t", "children": [{ "fieldName": "id", "expanded": true, "isAttribute": false, "leaf": true }, { "fieldName": "first_name", "expanded": true, "isAttribute": false, "leaf": true }, { "fieldName": "last_name", "expanded": true, "isAttribute": false, "leaf": true }, { "fieldName": "created_at", "expanded": true, "isAttribute": false, "leaf": true }] }] }
Considering Lead, Contact, and Customer as three Entities, you would have created the below files:
LeadResponse.xml
LeadRequest.xml
ContactResponse.xml
ContactRequest.xml
CustomerResponse.xml
CustomerRequest.xml
LeadResponse.json
LeadRequest.json
ContactResponse.json
ContactRequest.json
CustomerResponse.json
CustomerRequest.json
Create Triggers and Actions file
Create a new Text file named triggersAndActions.txt and edit it in text editor.
Paste the below JSON data in this text file. This JSON data is sample data having no Triggers and Actions in it.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [], // Actions List "actions": [], // URL mapping for Each Trigger and Action "urlMap": {}, // Method mapping for each trigger and Action "methodMap": {} }
For each entity identified in Step 1, create a Trigger object as shown below. The below JSON shows Trigger object for Entity "Lead".
Code Block language js title Trigger collapse true { // The name visible to user on GUI while selecting Trigger for this Connector "displayName" : "New Lead", "entityName": "Lead", // A unique value for this Trigger. "value": "newLead", "description": "Triggers when a new Lead is added to your account.", // Name of the xml file containing the fields of this entity "xmlLayoutPath": "LeadResponse.xml", // Name of the json file containing the fields of this entity "jsonLayoutPath": "LeadResponse.json", // The date field you want to specify to fetch incremental data for this entity. "field": "created_at" }
Add the Trigger Object to triggers field in triggersAndActions.txt. By adding a trigger the file would look similar to the one shown below.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" } ], // Actions List "actions": [], // URL mapping for Each Trigger and Action "urlMap": {}, // Method mapping for each trigger and Action "methodMap": {} }
Create New Trigger objects for each entity and add to triggers field. Below JSON shows triggersAndActions.txt file with two Triggers.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" }, { "displayName" : "New Contact", "entityName": "Contact", "value": "newContact", "description": "Triggers when a new Contact is added to your account.", "xmlLayoutPath": "ContactResponse.xml", "jsonLayoutPath": "ContactResponse.json", "field": "created_at" } ], // Actions List "actions": [], // URL mapping for Each Trigger and Action "urlMap": {}, // Method mapping for each trigger and Action "methodMap": {} }
For each entity identified in Step 1, create an Action object as shown below. The below JSON shows Action object for entity "Lead"
Code Block language js title Triggers and Actions JSON collapse true { // The name visible to user on GUI while selecting Trigger for this Connector "displayName" : "Create Lead", "entityName": "Lead", // A unique value for this Trigger. "value": "createLead", "description": "Creates a new Lead to your account.", // Name of the xml file containing the fields of this entity "xmlLayoutPath": "LeadResponse.xml", // Name of the json file containing the fields of this entity "jsonLayoutPath": "LeadResponse.json", }
Add the Action Object to actions field in triggersAndActions.txt. After adding the action, the file would look similar to the one shown below.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" }, { "displayName" : "New Contact", "entityName": "Contact", "value": "newContact", "description": "Triggers when a new Contact is added to your account.", "xmlLayoutPath": "ContactResponse.xml", "jsonLayoutPath": "ContactResponse.json", "field": "created_at" } ], // Actions List "actions": [ { "displayName" : "Create Lead", "entityName": "Lead", "value": "createLead", "description": "Creates a new Lead in your account", "xmlLayoutPath": "LeadRequest.xml", "jsonLayoutPath": "LeadRequest.json", } ], // URL mapping for Each Trigger and Action "urlMap": {}, // Method mapping for each trigger and Action "methodMap": {} }
Create New Action objects for each Entity and add to actions field. Below JSON shows triggersAndActions.txt file with two actions.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" }, { "displayName" : "New Contact", "entityName": "Contact", "value": "newContact", "description": "Triggers when a new Contact is added to your account.", "xmlLayoutPath": "ContactResponse.xml", "jsonLayoutPath": "ContactResponse.json", "field": "created_at" } ], // Actions List "actions": [ { "displayName" : "Create Lead", "entityName": "Lead", "value": "createLead", "description": "Creates a new Lead in your account", "xmlLayoutPath": "LeadRequest.xml", "jsonLayoutPath": "LeadRequest.json", }, { "displayName" : "Create Contact", "entityName": "Contact", "value": "createContact", "description": "Creates a new Contact in your account", "xmlLayoutPath": "ContactRequest.xml", "jsonLayoutPath": "ContactRequest.json", } ], // URL mapping for Each Trigger and Action "urlMap": {}, // Method mapping for each trigger and Action "methodMap": {} }
Add URL for each Trigger and Action defined in this file.
Define key-value pairs for each trigger and Action.
The key should be Trigger or Action value defined in triggers or actions field.
The value should be the complete URL endpoint to be hit for this particular trigger or action.
Define a special key-value pair for account Testing. The key should be "testaccount" and value should be the URL to test the Connectivity with connector account.
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" }, { "displayName" : "New Contact", "entityName": "Contact", "value": "newContact", "description": "Triggers when a new Contact is added to your account.", "xmlLayoutPath": "ContactResponse.xml", "jsonLayoutPath": "ContactResponse.json", "field": "created_at" } ], // Actions List "actions": [ { "displayName" : "Create Lead", "entityName": "Lead", "value": "createLead", "description": "Creates a new Lead in your account", "xmlLayoutPath": "LeadRequest.xml", "jsonLayoutPath": "LeadRequest.json", }, { "displayName" : "Create Contact", "entityName": "Contact", "value": "createContact", "description": "Creates a new Contact in your account", "xmlLayoutPath": "ContactRequest.xml", "jsonLayoutPath": "ContactRequest.json", } ], // URL mapping for Each Trigger and Action "urlMap": { "testaccount" : "< Test Connectivity URL >", "newLead" : "< Lead URL >", "newContact" : "< Contact URL >", "createLead" : "< Lead URL >", "createContact" : "< Contact URL >" }, // Method mapping for each trigger and Action "methodMap": {} }
Add method for each Trigger and Action defined in this file.
Define key-value pairs for each trigger and Action.
The key should be Trigger or Action value defined in triggers or actions field.
The value should be the complete http method to be used to hit URL for this particular trigger or action.
Define a special key-value pair for account Testing. The key should be "testaccount" and value should be the http method to be used to hit in order to test the Connectivity with connector account
Code Block language js title Triggers and Actions JSON collapse true { // Triggers List "triggers": [ { "displayName" : "New Lead", "entityName": "Lead", "value": "newLead", "description": "Triggers when a new Lead is added to your account.", "xmlLayoutPath": "LeadResponse.xml", "jsonLayoutPath": "LeadResponse.json", "field": "created_at" }, { "displayName" : "New Contact", "entityName": "Contact", "value": "newContact", "description": "Triggers when a new Contact is added to your account.", "xmlLayoutPath": "ContactResponse.xml", "jsonLayoutPath": "ContactResponse.json", "field": "created_at" } ], // Actions List "actions": [ { "displayName" : "Create Lead", "entityName": "Lead", "value": "createLead", "description": "Creates a new Lead in your account", "xmlLayoutPath": "LeadRequest.xml", "jsonLayoutPath": "LeadRequest.json", }, { "displayName" : "Create Contact", "entityName": "Contact", "value": "createContact", "description": "Creates a new Contact in your account", "xmlLayoutPath": "ContactRequest.xml", "jsonLayoutPath": "ContactRequest.json", } ], // URL mapping for Each Trigger and Action "urlMap": { "testaccount" : "< Test Connectivity URL >", "newLead" : "< Lead URL >", "newContact" : "< Contact URL >", "createLead" : "< Lead URL >", "createContact" : "< Contact URL >" }, // Method mapping for each trigger and Action "methodMap": { "testaccount" : "GET", "newLead" : "GET", "newContact" : "GET", "createLead" : "POST", "createContact" : "POST>" } }
Save this file. triggersAndActionsJson.txt file is ready.
Create Lookup file
Create an xml file named lookupConfiguration.xml
Paste below content into it.
Code Block language xml title Lookup Configuration collapse true <lookupConfiguration> <columns> </columns> <operators> </operators> </lookupConfiguration>
Add each Entity in Columns tag as shown below.
Code Block language xml title Lookup Configuration collapse true <lookupConfiguration> <columns> <entity type="Lead"> </entity> <entity type="Contact"> </entity> <entity type="Customer"> </entity> </columns> <operators> </operators> </lookupConfiguration>
Add attributes for each Entity as shown below.
Code Block language xml title Lookup Configuration collapse true <lookupConfiguration> <columns> <entity type="Lead"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> <entity type="Contact"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> <entity type="Customer"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> </columns> <operators> </operators> </lookupConfiguration>
Add Operators for each field Type and apiField type.
Code Block language xml title Lookup Configuration collapse true <lookupConfiguration> <columns> <entity type="Lead"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> <entity type="Contact"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> <entity type="Customer"> <column fieldValue="first_name" fieldName="first_name" fieldType="string" apiFieldType="string"/> </entity> </columns> <operators> <operator displayName="Equals" value="equals" type="string" apiFieldType="string"/> <operator displayName="Equals" value="equals" type="integer" apiFieldType="integer"/> <operator displayName="Equals" value="equals" type="boolean" apiFieldType="boolean"/> <operator displayName="Equals" value="equals" type="DateTime" apiFieldType="date-time"/> <string> <operator value="equals"/> </string> <integer> <operator value="equals"/> </integer> <boolean> <operator value="equals"/> </boolean> <DateTime> <operator value="equals"/> </DateTime> </operators> </lookupConfiguration>
Lookup Configuration file is ready.
Download the Image file
You can download the connector Image file from respective Connector Provider.
The image file should be in PNG format.
The name of the image can be any valid name.
Zip the individual files in a zip file
See the zip content below.
Panel | ||||
---|---|---|---|---|
| ||||
What is newBest practices/wiki/spaces/AC41/pages/15991686Adeptia Connect APIsAdeptia security report |