Changes

Jump to: navigation, search

SmartConnect - RESTful API

428 bytes added, 16:18, 15 June 2018
m
no edit summary
{{Banner-UnderConstruction}}
 
=Overview=
 
SmartSimple's SmartConnect API provides a relatively easy to use method of integrating SmartSimple information with other web services and systems. It is a RESTful API and loosely follows the principles of REST integration.
==Interactive Demonstration Page==
 
For a demo of how the API works, you can test some sample functions on our [https://api.smartsimple.com/devtools/dev_api.html interactive demonstration page]. This page is connected to a specific demonstration instance containing sample data. We strongly encourage you to review this page in order to gain a better understanding of the syntax and functionality of the API.
=Prerequisites=
 
* This API is only available for SmartSimple environments on the November 2015 release or later. We recommend you upgrade to the latest available release for the most up to date API functionality.
=Configuration - Essentials=
 
==Initial Setup==
 
You will need an active SmartSimple user account in order to make any API calls. There are two modes of operation for this API, and if you are planning on making remote calls you will first need to create and activate an API type user.
* '''Active session''': Where a user is already logged into SmartSimple with an active session and makes an API call from their web browser, e.g. an AJAX call. The user's existing session is used to authenticate the API call.
* '''Remote call''': Where an external system makes an API call. For this method, a user account of type API Access is required to authenticate the API call. [[File:Access_type_API.png|thumb|none|middle|200px|Roles and access setting of a user to be used for remote calls.]]
==Function Definition==
 
In order to use the API, you must first define the set of functions you wish to make available within SmartSimple. This is an added layer of security that lets you limit the available functions as well as field sets that you wish to expose through the API.
===Field List Syntax===
 
The ''Field List'' option within the function configuration is used to define which fields are retrievable through the function call. This is a free form text box in which you will need to construct your field list with the following syntax:
{| class="wikitable"
|-
!| Syntax!| Description!| Example
|-
|| sf_''StandardFieldName''|| Standard fields are denoted by their name, preceded by a prefix of 'sf_'|| sf_First Name
|-
|| cf_''CustomFieldName''|| Custom fields are denoted by their name, preceded by a prefix of 'cf_'|| cf_My Custom Field
|-
|| ;;|| Field Separator. Multiple fields are separated using the literal characters ';;'|| sf_First Name;;cf_My Custom Field
|}
==Usage==
 
===Posting Endpoints===
 
To make an API call you will need to post to the appropriate endpoint which will simply be based on the ''Object Type'' of the API function. The general endpoint will be in the form of:
{| class="wikitable"
|-
!| Object Type!| Endpoint!| Example
|-
|| Report|| /API/1/report/|| https://example.smartsimple.com/API/1/report/
|-
|| Company|| /API/1/company/|| https://example.smartsimple.com/API/1/company/
|-
|| User|| /API/1/user/|| https://example.smartsimple.com/API/1/user/
|-
|| System Variables| |/API/1/sysvar/| |https://example.smartsimple.com/API/1/sysvar/
|-
|| UTA Level 1|| /API/1/levelone/|| https://example.smartsimple.com/API/1/levelone/
|-
|| UTA Level 2|| /API/1/leveltwo/|| https://example.smartsimple.com/API/1/leveltwo/
|-
|| UTA Level 3|| /API/1/levelthree/|| https://example.smartsimple.com/API/1/levelthree/
|-
|| UTA Level Transaction| |/API/1/transactions/| |https://example.smartsimple.com/API/1/transactions/
|}
===Message Body===
The message body that you post will need to include various parameters depending on the ''Object Type'' and ''Action Type'' being used. The required and optional parameters will be listed for each different function on the configuration page of each SmartConnect function. At minimum though, you will always need to include:
The message body that you post will need to include various parameters depending on the ''Object Type'' and ''Action Type'' being used. The required and optional parameters will be listed for each different function on the configuration page of each SmartConnect function. At minimum though, you will always need to include:
* '''url''': The URL to post to.
* '''apitoken''': The unique ID generated and associated to each SmartConnect function.
If you are making a remote call from an external system you will also need to include:
 
* '''username''': The email address of an active API type user account.
* '''password''': The corresponding password to the above user account.
==Update Behaviour==
Please note when performing updates that the system behaviour will be similar to that of saving the record in the regular browser interface. Namely, the following will occur:
Please note when performing updates that the system behaviour will be similar to that of saving the record in the regular browser interface. Namely, the following will occur:
* Any existing and applicable template formulas will be triggered and run after a record update.
* Any existing and applicable workflows will be triggered and run after a record update.
=Configuration - Advanced=
 
=Appendix=
 
==Options and Settings==
 
<!--Explain all applicable misc options and settings that shouldn't be explained above here...-->
 
===Available Object Types===
 
{| class="wikitable"
!| Record
!| Description
|-
!|Record!|Description|-|| Report|| Run a report and retrieve the results.
|-
|| Company|| Organization records.
|-
|| User|| Contact records.
|-
|| System Variables|| Global System Variables.
|-
|| UTA Records|| UTA records, including Level 1, 2, 3, and transactions.
|}
===Available Action Types===
 
The following is a full list of available actions. Please note that not all actions will be available for all object types.
{| class="wikitable"
!| Action
!| Description
|-
!|Action!|Description|-|| Get|| Retrieve a single record for the record type you have selected in the function.|-||List||Retrieve multiple records for the record type you have selected in the function.
|-
| List|Update| Retrieve multiple records |Update one or more fields for the specified record type you have selected in the function/s. Update is also used to create new records.
|-
| Update|Get Meta| Update one or more fields |Retrieve the configuration settings for the specified recorda UTA with respect to Level 1/2/s. Update is also used to create new records3 attributes such as types, statuses, field definitions.
|-
| Get |Update Meta| Retrieve |Update the configuration settings for a UTA with respect to Level 1/2/3 attributes such as types, statuses, field definitions.
|-
| Update Meta|Download File| Update the configuration settings for |Download a single file from a UTA with respect to Level 1/2/3 attributes such as types, statuses, specified record and field definitions.
|-
| Download File|List Files| Download |Retrieves a single file list of files from a specified record and field.
|-
| List |Search Files| Retrieves |Retrieve a list of files from a containing specified record and fieldstring values.
|-
| Search Files|Update Associations| Retrieve |Update one or more fields in the association table between two records. Update is also used to create new association records. E.g. The contacts or organizations associated to a list of files containing specified string valuesUTA Level 1 record.
|-
| Update |List Associations| Update one or more fields in |Retrieves a list of associations for the association table between two records. Update is also used to create new association recordsspecified record. E.g. The contacts or organizations associated to a UTA Level 1 record.
|-
|| List AssociationsMultiple Addresses|| Retrieves a list of associations addresses for the specified record. E.g. The contacts contact or organizations associated to a UTA Level 1 organization record.
|-
| List |Update Multiple Addresses| Retrieves a list of addresses |Update one or more fields for the specified address for a contact or organization record. Update is also used to create new address records.
|-
| Update Multiple Addresses|Variables Replace| Update one or more fields for |Returns formatted content processed by the variable processor from a specified address record.  The system will replace all variables within the content parameter with variable values from that object.  E.g. Passing in "Hello @firstname@" as content for a contact or organization record. Update is also used to create new address recordsname John Smith will return "Hello John".
|}
=Examples=
 
 
 
<!--
-->
 
[[Category:Integration]][[Category:API]][[Category:SmartConnect RESTful API]]
0
edits

Navigation menu