Difference between revisions of "Creating SmartConnect Functions"

From SmartWiki
Jump to: navigation, search
Line 24: Line 24:
  
 
===Get===
 
===Get===
====Get Method Sample 1: Retrieve a Single Organization Record====
+
====''Get Method'' Sample 1: Retrieve a Single Organization Record====
 
This function will retrieve a single record from the organization using the [[Determining_the_companyid|Company ID]]. The function is set up to retrieve the fields listed under '''Field List'''.
 
This function will retrieve a single record from the organization using the [[Determining_the_companyid|Company ID]]. The function is set up to retrieve the fields listed under '''Field List'''.
  
Line 34: Line 34:
 
[[File:APIFunctionSample1.PNG|800px]]
 
[[File:APIFunctionSample1.PNG|800px]]
  
====Get Method Sample 2: Retrieve a Single Contact Record====
+
====''Get Method'' Sample 2: Retrieve a Single Contact Record====
 
This function will retrieve a single record from the users table using the [[Determining_the_userid|User ID]]. The function is set up to retrieve the fields listed under '''Field List'''.
 
This function will retrieve a single record from the users table using the [[Determining_the_userid|User ID]]. The function is set up to retrieve the fields listed under '''Field List'''.
  
Line 44: Line 44:
 
[[File:APIFunctionSample2.PNG|800px]]
 
[[File:APIFunctionSample2.PNG|800px]]
  
====Get Method Sample 3: Retrieve a Single Grant Application Record====
+
====''Get Method'' Sample 3: Retrieve a Single Grant Application Record====
 
This function will retrieve a single record from the [[Universal Tracking Application]] Level 1 using the [[Determining_the_opportunityid|Opportunity ID]].
 
This function will retrieve a single record from the [[Universal Tracking Application]] Level 1 using the [[Determining_the_opportunityid|Opportunity ID]].
  
Line 54: Line 54:
 
[[File:APIFunctionSample3.PNG|800px]]
 
[[File:APIFunctionSample3.PNG|800px]]
  
====Get Method Sample 4: Retrieve a Single Grant Application Payment Record====
+
====''Get Method'' Sample 4: Retrieve a Single Grant Application Payment Record====
 
This function will retrieve a single record from the [[Universal Tracking Application]] Level 2 using the [[Determining_the_eventid|Event ID]].
 
This function will retrieve a single record from the [[Universal Tracking Application]] Level 2 using the [[Determining_the_eventid|Event ID]].
  
Line 142: Line 142:
 
=====List Files Method Sample 1:  from an organization=====
 
=====List Files Method Sample 1:  from an organization=====
 
=====List Files Method Sample 2: from an application=====
 
=====List Files Method Sample 2: from an application=====
 
 
====List Notes====
 
====List Notes====
 
=====List Notes Method Sample 1:  from an application=====
 
=====List Notes Method Sample 1:  from an application=====
 
 
====List Multiple Addresses====
 
====List Multiple Addresses====
 
=====List Multiple Addresses Method Sample 1: Multiple Addresses of an Organization=====
 
=====List Multiple Addresses Method Sample 1: Multiple Addresses of an Organization=====
 
 
====List Associations====
 
====List Associations====
 
=====List Associations Method Sample 1: Contact associations from an application=====
 
=====List Associations Method Sample 1: Contact associations from an application=====
 
=====List Associations Method Sample 2: Organization associations from an application=====
 
=====List Associations Method Sample 2: Organization associations from an application=====
 
 
 
 
==='Metadata'===
 
==='Metadata'===
 
====Get Metadata Sample 1: CMS360°: Application Metadata====
 
====Get Metadata Sample 1: CMS360°: Application Metadata====
 
====Get Metadata Sample 1: GMS360°: Application Metadata====
 
====Get Metadata Sample 1: GMS360°: Application Metadata====
 
 
 
 
===Update===
 
===Update===
 
====Update====
 
====Update====
 
=====Update Method Sample 1: Create organizations=====
 
=====Update Method Sample 1: Create organizations=====
 
=====Update Method Sample 2: Create/Update User=====
 
=====Update Method Sample 2: Create/Update User=====
 
 
 
 
====Update Multiple Addresses====
 
====Update Multiple Addresses====
 
=====Update Multiple Addresses Method Sample 1: update addresses of an Organization=====
 
=====Update Multiple Addresses Method Sample 1: update addresses of an Organization=====
 
 
====Update Associations====
 
====Update Associations====
 
=====Update Associations Method Sample 1: update contact associations of a Level 1=====
 
=====Update Associations Method Sample 1: update contact associations of a Level 1=====
 
 
 
 
==='Download File'===
 
==='Download File'===
 
04.1 Download File Method Sample 1: Download file(s) from a company profile
 
04.1 Download File Method Sample 1: Download file(s) from a company profile
 +
  
  

Revision as of 15:37, 29 August 2018


Construction warning.png Please note that this page is currently under construction. There is more information to come.

SmartConnect functions are specific to individual copies of SmartSimple so you can only use the functions that are have been previously established in that copy. The article describes how you add functions to an instance.

Contents

Creating a New Function

You need to have Global User Administrator permissions in order to add JSON functions.

  1. Log into the copy of SmartSimple where you wish to add the function.
  2. Navigate to Global Settings.
  3. Click on the Integrations tab.
  4. Click on the SmartConnect API link. Existing functions will be listed here for you to update.
  5. Click on the + button to create a new function.

Function Settings

Each function has the following settings:

  • Function Name – you will use this name to call the function from your own code.
  • Description – used to provide documentation as to the function’s purpose.
  • Record Type – a list of all SmartSimple objects within this instance. This will include: Report (reports you have created in the instance), Organization (company records), Users (system users and contacts), and each Universal Tracking Application™ Level 1, Level 2 and Level 3 type that you have created in the instance.
  • Action Type – this defines the action to be taken by the function. The following actions are available:  GET META, UPDATE META, GET, LIST, UPDATE, UPDATE ASSOCIATIONS, LIST ASSOCIATIONS, DOWNLOAD FILE, LIST FILES, SEARCH FILES, LIST NOTES and  VARIABLE REPLACE. Details on these Action Types / Methods are available below.
  • Field List – this restricts the fields that are to be retrieved from the underlying object.

SmartConnect Function Samples

Visit the interactive demonstration page to test the sample functions.

Get

Get Method Sample 1: Retrieve a Single Organization Record

This function will retrieve a single record from the organization using the Company ID. The function is set up to retrieve the fields listed under Field List.

Function Name  -  3.01.1 Get Method Sample 1: Retrieve a Single Organization Record
Object Type  -  Company
Action Type   -  Get
Field List  -  sf_Company ID;;sf_Name;;sf_Address;;sf_City;;sf_Country;;sf_Zip / Postal Code;;cf_EIN Number;;sf_Mission Statement

APIFunctionSample1.PNG

Get Method Sample 2: Retrieve a Single Contact Record

This function will retrieve a single record from the users table using the User ID. The function is set up to retrieve the fields listed under Field List.

Function Name  -  3.01.2 Get Method Sample 2: Retrieve a Single Contact Record
Object Type  -  User
Action Type   -  Get
Field List  -  sf_User ID;;sf_Last Name;;sf_First Name;;sf_Prefix;;sf_Suffix;;sf_Title;;sf_Phone;;sf_Email

APIFunctionSample2.PNG

Get Method Sample 3: Retrieve a Single Grant Application Record

This function will retrieve a single record from the Universal Tracking Application Level 1 using the Opportunity ID.

Function Name  -  3.01.3 Get Method Sample 3: Retrieve a Single Grant Application Record
Object Type  -  Submission Manager - Grant
Action Type   -  Get
Field List  -  cf_Project Name;;cf_Submission Number;;sf_Application Type;;sf_Status;;sf_Customer;;sf_Owner;;cf_Focus Area;;cf_Amount Requested;;cf_Program Area;;cf_Location;;cf_Proposed Start Date;;cf_Proposed End Date

APIFunctionSample3.PNG

Get Method Sample 4: Retrieve a Single Grant Application Payment Record

This function will retrieve a single record from the Universal Tracking Application Level 2 using the Event ID.

Function Name  -  3.01.4 Get Method Sample 4: Retrieve a Single Grant Application Payment Record
Object Type  -  Submission Manager - Activity
Action Type   -  Get
Field List  -  sf_Status;;sf_Activity Type;;cf_Payment ID;;cf_Payment Amount;;cf_Payment Date;;Payment Notes

APIFunctionSample4.PNG

Report

Get Report Sample: Report Query

Function Name  -  3.02.1 Get Report Sample 1: Report Query
Object Type  -  Report
Action Type   -  Query
Field List  - none

Sample 1: Assessor count by specialty

Sample 1 will display the number of Assessors based on their specialty
--Begin custom parameter --
reportid : 36864
criteriavalue: none
--End custom parameter--

Sample 2: List of Grants grouped by Organization

Sample 2 shows a list of applications filtered by "Approved Proposal" status grouped by organizations
--Begin custom parameter --
reportid : 36812
criteriavalue: none
--End custom parameter--

Sample 3: List of Grants grouped by Focus Area

Sample 3 displays a list of applications grouped by focus area
--Begin custom parameter --
reportid : 36814
criteriavalue: none
--End custom parameter--

Sample 4: List of Payments grouped by Grant Type

Sample 4 displays the payment amount for each grant grouped by organization
--Begin custom parameter --
reportid : 36806
criteriavalue: none
--End custom parameter--

List

List

List Method Sample 1: Retrieve a list of contacts

Function will retrieve a list of contacts based on criteria specified.

Function Name  -  3.02.1 List Method Sample 1: Retrieve a list of Contacts
Object Type  -  User
Action Type   -  List
Field List  -  sf_User ID;;sf_First Name;;sf_Address;;sf_Address 2;;sf_City;;sf_Country;;sf_State / Province;;sf_Zip / Postal Code;;

Sample 1A: To retrieve a list of contacts where the first name begins with "J" and sorted by first name in ascending order 
--Begin custom parameter --
criteria : [{"andor":"or","field":"sf_First Name","operator":"like","value":"J%"}]
sortby : [{"field":"sf_First Name","direction":"asc"}]
getstorevalue :
--End custom parameter--

APIFunctionSample5a.PNG

Sample 1B: To retrieve a list of contacts where the first name begins with "S" and the address contains "Peter" and sorted by first name in ascending order 
--Begin custom parameter --
criteria : [{"andor":"or","field":"sf_First Name","operator":"like","value":"S%"},
{"andor":"and","field":"sf_Address","operator":"like","value":"%Peter%"}]
sortby : [{"field":"sf_First Name","direction":"asc"}]
getstorevalue :
--End custom parameter--

APIFunctionSample5b.PNG

List Method Sample 2: Retrieve a list of organizations

Function Name  -  x
Object Type  -  x
Action Type   -  x
Field List  -  x

List Method Sample 3: CMS360° - Retrieve a list of claims

Function Name  -  x
Object Type  -  x
Action Type   -  x
Field List  -  x

List File

List Files Method Sample 1:  from an organization
List Files Method Sample 2: from an application

List Notes

List Notes Method Sample 1:  from an application

List Multiple Addresses

List Multiple Addresses Method Sample 1: Multiple Addresses of an Organization

List Associations

List Associations Method Sample 1: Contact associations from an application
List Associations Method Sample 2: Organization associations from an application

'Metadata'

Get Metadata Sample 1: CMS360°: Application Metadata

Get Metadata Sample 1: GMS360°: Application Metadata

Update

Update

Update Method Sample 1: Create organizations
Update Method Sample 2: Create/Update User

Update Multiple Addresses

Update Multiple Addresses Method Sample 1: update addresses of an Organization

Update Associations

Update Associations Method Sample 1: update contact associations of a Level 1

'Download File'

04.1 Download File Method Sample 1: Download file(s) from a company profile


'Search File'

06.1 Search Files Method Sample 1: Search Case Documents





See Also

SmartConnect - RESTful API
JSON API (SmartConnect) Standard Field Names


API Sample Code