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.
* '''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''' – is used to define which fields are retrievable through the function call. Please limit field list to ~50 standard fields/custom fields.
==Configurations and Responses==
'''Object Type''' - Company<br />
'''Action Type ''' - Get Meta<br />
'''Field List''' - companies.*<br />
No parameters are needed to retrieve metadata.
[[File:APIFunctionGetOrgMeta.PNG|800px]]
====Get Metadata from Contacts====
<!--63342 - SmartConnect API - metadata option to include Orgs/Contacts-->
'''Field List''' - contacts.*<br />
No parameters are needed to retrieve metadata.
[[File:APIFunctionGetUserMeta.PNG|800px]]
===Report===
This function will retrieve the results of the query from an existing report by using the [[Determining_the_reportid|'''reportid''']].
====Retrieve a Single Organization Record====
'''Function Name''' - 3.03.1 Get Method Sample 1: Retrieve a Single Organization Record<br />
'''Description''' - This function will retrieve a single record from the organization using the recordid: [[Determining_the_companyid|Company ID]]. The function is set up to retrieve the fields listed under under '''Field List'''.<br />
'''Object Type''' - Company<br />
'''Action Type ''' - Get<br />
: '''''sample3:'''''
: An example query with brackets: ( (cf_somefield1 like '%whatever%' or cf_somefield2 like '%whatever%' or cf_somefield3 like '%whatever%' or cf_somefield4like '%whatever%' ) and (cf_someotherfield1='whatever' or cf_someotherfield2='whatever else'))
objectid - is the [[Determining_the_opportunityid|Opportunity ID]] where the user will be associated to.<br/>
contactid - [[Determining_the_userid|User ID]]<br/>rolename / roleid - association role of the user<br/>isupdate - "1" for yes to update and "0" for to add new record <br/>
Note: In the API website, the content of the file will be shown in the Response section as seen below.<br />[https://api.smartsimple.com/API/1/report/?url=https://api.smartsimple.com/API/1/report/&companyid=825646&alias=api&username=dataimport@smartsimple.com&password=smartsimple1&apitoken=W0t2dV58fmZGR1lzUmVDc2xibnd8BEdfAgMBAg~~&filename=Test.txt&objectid=1688407&fieldid=1523157| Click here to download the file]
[[File:APIFunctionDownloadFile1.PNG|800px]]
====Upload File(s) to a field in the company profile====
<!--122516 - API file upload-->
'''Function Name''' - 3.06.2 Upload File Method Sample 1: Upload file(s) to an existing company record<br />
'''Description''' - Upload the file based on the criteria indicated.<br />
'''Object Type''' - Company<br />
'''Action Type ''' - Upload Files<br />
'''Field List''' - cf_123456
'''
Mandatory fields''' to upload a file:
objectid - is the [wiki/Determining_the_companyid Company ID] where the file is attached to.<br />
fieldid - [wiki/Custom_Field_ID Custom Field ID] of the Organization record that is either a [wiki/Custom_Field_Type:_Upload_-_Single_File_Storage single file type] or [wiki/Custom_Field_Type:_Upload_-_Multiple_Files_Storage multiple file type].
--Begin custom parameter --<br />
objectid: 1688407<br />
fieldid: 1523157<br />
--End custom parameter--
<br />Note: To test use Postman.
The API URL for upload file will be:
https://alias.smartsimple.com/API/1/company/?alias=xxxxx&companyid=xxxxxx&username=xxxxx&password=xxxxx&apitoken=xxxxx&objectid=xxxxx&fieldid=xxxxx<br />with the file included in the form data, use POST method.
===Search File===
This function will retrieve a list of files by searching for a keyword.
jsonrset : [{"recordid":"1924628"}]<br />
--End custom parameter--
[[File:Delete_org.PNG|800px]]
[[File:Delete_user.PNG|800px]]
====Delete Organization Records (Batch delete)====
'''Description''' - Delete existing user record <br />
'''Object Type''' - User<br />
'''Action Type ''' - Delete<br />
'''Field List''' -
--Begin custom parameter --<br />
jsonrset : [{"recordid":"88173129"}]<br />
--End custom parameter--
====Delete a Single Grant Application Record====
[[File:APIFunctionDeleteL1User.PNG|800px]]
====Delete Multiple Upload Files====
<!-- 138847 - API function to delete files -->
After the July 2023 upgrade, new function to delete files from Upload - Multiple Files Storage fields was added.
'''Function Name''' - 3.09.6 Delete Files in Level One<br />
'''Description''' - Delete existing files from a multiple file field in [[Category:Universal_Tracking_Application|Universal Tracking Application]] Level 1 record<br />
<!--72195 - SmartConnect Function on Transaction Applied to prod for May 2019 Upgrade-->
* <span style="color: #ff0000;">Available after May 2019 upgrade.</span>
* Transaction should be [[Category:Transactions Transaction_Attribution| configured]] before using this API function. Transactions can be attached to an object (Organization or User or UTA L1/L2).
====Get Transaction Record====
=====Get a Transaction Record from an Organization====='''Function Name''' - 3.0310.6 1.1 Get a Transaction Record from an Organization<br />'''Description''' - Retrieve an organization transaction record <br />'''Object Type''' - Company Transactions<br />'''Action Type ''' - Get<br />'''Field List''' - sf_Transaction ID;;sf_Object ID;;sf_Description;;sf_Subject;;sf_Type;;sf_Status;;sf_Created Date;;sf_Modified Date;;sf_Created By;;sf_Updated By '''Mandatory fields''' to get a transaction record:<br/>recordid - the unique identifier from the transaction table. --Begin custom parameter --<br />recordid:2738520<br />othersettings :<br />--End custom parameter-- [[File:TransactionGet1.PNG|800px]] =====Retrieve a Transaction Record from a Submission Manager L1====='''Function Name''' - 3.10.1.2 Get Method Sample 4: Retrieve a Transaction Record from a Submission Manager L1<br />
'''Description''' - Retrieve a transaction record <br />
=====Create or Update Transaction Record in Organization Profile====='''Function Name''' - 3.0510.53.1 Create or Update Transaction Record in Organization Profile<br />'''Description''' - Create new transaction record attached to a Organization record <br />'''Object Type''' - Company Transactions<br />'''Action Type ''' - Update<br />'''Field List''' - sf_Transaction ID;;sf_Object ID;;sf_Description;;sf_Subject;;sf_Type;;sf_Status;;sf_Created Date;;sf_Modified Date;;sf_Created By;;sf_Updated By '''Mandatory fields''' to add a new transaction record:<br/>recordid - the unique identifier from the transaction table. To create new record, recordid should be '0'<br/>sf_Object ID - is the object(Organization, User, UTA L1/L2) the transaction would be attached to.<br/>sf_Type - [[Transaction_Custom_and_Standard_Field_Types|Transaction Type]] of the transaction record.<br/>sf_Status - [[Transaction_Status|Transaction Status]] of the transaction record. <u>'''Sample 3A'''</u><br/>'''Description''' - Create new transaction record <br />--Begin custom parameter --<br />jsonrset : [{"recordid":"0","sf_Object ID":"10697883","sf_Type":"2184","sf_Status":"82626","sf_Subject":"Test Transaction Record"}]<br />--End custom parameter-- [[File:TransactionUpdate2.PNG|800px]] <u>'''Sample 3B'''</u><br/>'''Description''' - Update existing transaction record <br />--Begin custom parameter --<br />jsonrset : [{"recordid":"2738520","sf_Subject":"Changed subject thru api"}]<br />--End custom parameter-- [[File:TransactionUpdate1.PNG|800px]] =====Create or Update Transaction Record in Submission Manager L1=====<u>'''Sample A''' - creating new transaction record from API v1</u><br/>'''Function Name''' - 3.10.3.2 Create or Update Transaction Record in Submission Manager L1<br />
'''Description''' - Create new transaction record attached to a Submission Manager L1 record <br />
Note that translevel is new in version 2 where translevel=1 for UTA L1 and translevel=2 for UTA L2.
'''Mandatory fields''' to add a new transaction record:<br/>
recordid - the unique identifier from the transaction table. To create new record, recordid should be '0'<br/>
sf_Object ID - is the object(UTA L1) the transaction would be attached to.<br/>
sf_Type - [[Transaction_Custom_and_Standard_Field_Types|Transaction Type]] of the transaction record.<br/>
sf_Status - [[Transaction_Status|Transaction Status]] of the transaction record.<br/>
translevel - is the UTA Level (UTA L1/L2) the transaction would be attached to. <span style="color: #ff0000;">(NEW that is implemented in API v2)</span>
Note that translevel is new in version 2 where translevel=1 for UTA L1 and translevel=2 for UTA L2.<br/>
'''Mandatory fields''' to add a new transaction record:<br/>
recordid - the unique identifier from the transaction table. To create new record, recordid should be '0'<br/>
sf_Object ID - is the object(UTA L2) the transaction would be attached to.<br/>
sf_Type - [[Transaction_Custom_and_Standard_Field_Types|Transaction Type]] of the transaction record.<br/>
sf_Status - [[Transaction_Status|Transaction Status]] of the transaction record.<br/>
translevel - is the UTA Level (UTA L1/L2) the transaction would be attached to. <span style="color: #ff0000;">(NEW that is implemented in API v2)</span><br/>
'''Description''' - Delete a transaction record <br />
'''Object Type''' - Submission Manager - Company Transactions<br />
'''Action Type ''' - Delete<br />
'''Field List''' -
--Begin custom parameter --<br />
jsonrset : [{"recordid":"27379922738523"}]<br />
--End custom parameter--
[[File:TransactionDelete1.PNG|800px]] ====Link/Unlink Transaction Record from other objects====<!--134010 - SmartConnect API link and unlink transactions from Objects-->This new feature to link/unlink transactions is only available in APIv2 and only for L1 & L2 transactions. <u>'''Sample A - Link existing transactions to an existing L1'''</u><br/>'''Function Name''' - Link transaction record to an existing Submission Manager L1<br data-attributes="%20/"> '''Description''' - Link existing company transaction record to an existing Submission Manager L1 record<br data-attributes="%20/"> '''Object Type''' - Submission Manager - Transactions<br data-attributes="%20/"> '''Action Type ''' - Link / Unlink<br data-attributes="%20/"> '''Field List''' - cf_5469887 '''Mandatory fields''' sf_Object ID - is the object(UTA L1 id) the transaction would be attached to. <br/>translevel - level in the UTA to link the transaction to.<br/>sf_ transaction id - is the existing transaction record id.<br/>islink - indicates to link the transaction to a record.<br/>cf_5469887 - transaction custom field.<br/> --Begin custom parameter --<br/> jsonrset : [{"recordid":"0","sf_Object ID":"1123456","translevel":"1","cf_5469887":"Test linking Transaction to SML1","sf_transaction id":"6165326","islink":"1"}]<br/> --End custom parameter--<br/> <u>'''Sample B - Unlink existing transactions to an existing L1'''</u><br data-attributes="/"> '''Function Name''' - Unlink transaction record to an existing Submission Manager L1<br/> '''Description''' - Unlink existing company transaction record from the Submission Manager L1 record<br/> '''Object Type''' - Submission Manager - Transactions<br/> '''Action Type ''' - Link / Unlink<br/> '''Field List''' - '''Mandatory fields'''<br/>sf_Object ID - is the object(UTA L1 id) the transaction would be attached to.<br/>translevel - level in the UTA to link the transaction to.<br/>sf_ transaction id - is the existing transaction record id.<br/>unlink - indicates to link the transaction to a record.<br/> --Begin custom parameter --<br/> jsonrset : [{"sf_Object ID":"1123456","translevel":"1","sf_transaction id":"6165326","unlink":"1"}]<br/>--End custom parameter--<br/> <u>'''Sample C - Link existing transactions to an existing L2'''</u><br data-attributes="/"> '''Function Name''' - Link transaction record to an existing Submission Manager L2<br/> '''Description''' - Link existing company transaction record to an existing Submission Manager L2 record<br/> '''Object Type''' - Submission Manager - Transactions<br/> '''Action Type ''' - Link / Unlink<br/> '''Field List''' - cf_5469887 '''Mandatory fields''' <br/>sf_Object ID - is the object(UTA L2 id) the transaction would be attached to.<br/>translevel - level in the UTA to link the transaction to.<br/>sf_ transaction id - is the existing transaction record id.<br/>islink - indicates to link the transaction to a record.<br/>cf_5469887 - transaction custom field.<br/> --Begin custom parameter --<br/> jsonrset : [{"recordid":"0","sf_Object ID":"50268865","translevel":"2","cf_5469887":"Test linking Transaction to SML2","sf_transaction id":"6165326","islink":"1"}]<br/>--End custom parameter--<br/> <u>'''Sample D - Unlink existing transactions to an existing L2'''</u><br/> '''Function Name''' - Unlink transaction record to an existing Submission Manager L2<br/> '''Description''' - Unlink existing company transaction record from the Submission Manager L2 record<br/> '''Object Type''' - Submission Manager - Transactions<br/> '''Action Type ''' - Link / Unlink<br/> '''Field List''' - '''Mandatory fields''' <br/>sf_Object ID - is the object(UTA L2 id) the transaction would be attached to.<br/>translevel - level in the UTA to link the transaction to.<br/>sf_ transaction id - is the existing transaction record id.<br/>unlink - indicates to link the transaction to a record.<br/> --Begin custom parameter --<br/> jsonrset : [{"sf_Object ID":"50268865","translevel":"2","sf_transaction id":"6165326","unlink":"1"}]<br/>--End custom parameter--<br/> ===UTA Consumer/Provider Table===
<!--85831 - SmartConnect to support Consumer/Provider link Applied to prod for May 2019 Upgrade-->
* <span style="color: #ff0000;">Available after May 2019 upgrade.</span>
Consumer/Provider Relationship should be [[Configuring_UTA_Provider/Receiver_(Consumer)_Relationships | configured]] before using this API function. UTA Provider/Consumer Relationships allows for the sharing of data between different [[UTA|UTAs]].
====Get Consumer/Provider Record===='''Function NameNotes''' - <br />'''Description''' - 1. For May 2019 upgrade, add/update function will not support custom fields of the relationship.<br />'''Object Type''' - 2. Update function is only used to update role between consumer/provider. When roleid/rolename is updated, all custom fields of the relationship from the previous role will be deleted.<br />3. To update either the consumerid or the providerid of the consumer/provider record, these ids can'''Action Type ''' - <br t be updated. The record should be delete first and then add new consumer/>provider record.'''Field 3. List''' - <br />function supports standard fields and custom fields of the relationship.
====List Consumer/Provider Records====
'''Function Name''' - 3.11.1 List Consumer/Provider Records<br />'''Description''' - Get a list of all Consumer/Provider records<br />'''Object Type''' - Submission Manager - Grant<br />'''Action Type ''' - List Provider / Consumer Link<br />'''Field ListProvider/Consumer Link ''' - Meeting Manager - L1 to Submission Manager - L1<br />'''Field List''' -
<u>'''Sample 1A'''</u><br/>
'''Description''' - Retrieve list of all consumer/provider records <br />
--Begin custom parameter --<br />
criteria:<br />
sortby:<br />
othersettings :<br />
--End custom parameter--
[[File:ConsumerProviderList1.PNG|800px]]
====Create or Update or Delete Consumer/Provider Record====
'''Function Name''' - 3.11.2 Create or Update or Delete Consumer/Provide Records<br />
'''Description''' - Create, update or delete consumer/provider records<br />