Difference between revisions of "JSON API (SmartConnect)"

From SmartWiki
Jump to: navigation, search
(See Also)
Line 4: Line 4:
 
The API uses industry '''standard JSON syntax and constructs'''. If you are not familiar with JSON you should take a look at the [https://www.w3schools.com/js/js_json_intro.asp following tutorial] before venturing much further in this topic:
 
The API uses industry '''standard JSON syntax and constructs'''. If you are not familiar with JSON you should take a look at the [https://www.w3schools.com/js/js_json_intro.asp following tutorial] before venturing much further in this topic:
  
== SmartSimple System Version ==
+
==SmartSimple System Version==
 
{| class="wikitable"
 
{| class="wikitable"
|Clients must be on the November 2015 or a more recent upgrade to use the API.
+
|-
 +
||Clients must be on the November 2015 or a more recent upgrade to use the API.
 
|}
 
|}
  
== General Overview of the API ==
+
==General Overview of the API==
 
 
 
In order to use the API you will take the following steps:
 
In order to use the API you will take the following steps:
  
Line 17: Line 17:
 
* Each function you create is linked to a specific SmartSimple object such as Organization, Contact, Report, Universal Tracking Application Level 1 object, Level 2 and level 3.
 
* Each function you create is linked to a specific SmartSimple object such as Organization, Contact, Report, Universal Tracking Application Level 1 object, Level 2 and level 3.
  
* You define the fields that can be retrieved from that object through that function. This approach ensures that you never expose data to the API that you don't want people to use in the API.
+
* You define the fields that can be retrieved from that object through that function. This approach ensures that you never expose data to the API that you don't want people to use in the API.
  
* You choose the Action Type that you wish to use for the function. Currently there are five action types:
+
* You choose the Action Type that you wish to use for the function. Currently there are five action types:
 
** '''Get''' - Retrieve a single record for the object type you have selected in the function.
 
** '''Get''' - Retrieve a single record for the object type you have selected in the function.
 
** '''List''' - Retrieve multiple records or the object type you have selected in the function.
 
** '''List''' - Retrieve multiple records or the object type you have selected in the function.
** '''Update''' - Change data in one or more fields in the object you have retrieved. Update is also used to create new objects.
+
** '''Update''' - Change data in one or more fields in the object you have retrieved. Update is also used to create new objects.
 
** '''Download File''' - Downloads to the browser a file you have retrieved.
 
** '''Download File''' - Downloads to the browser a file you have retrieved.
 
** '''List Files''' - Retrieves a list of files from a specified object.
 
** '''List Files''' - Retrieves a list of files from a specified object.
 
** '''Search Files''' - Retrieve a list of files containing specific string values.
 
** '''Search Files''' - Retrieve a list of files containing specific string values.
  
* Once saved, each function will generates and display a key that is unique to that function in that instance. You cannot use the function unless you supply the key.
+
* Once saved, each function will generates and display a key that is unique to that function in that instance. You cannot use the function unless you supply the key.
  
 
Note: SmartSimple will increase the Action Types as we continue to enhance the API.
 
Note: SmartSimple will increase the Action Types as we continue to enhance the API.
  
== JSON API Interactive Demonstration Page ==
+
==JSON API Interactive Demonstration Page==
 +
If you want to review how the API works and interact with some sample functions and test data be sure to visit the '''[https://api.smartsimple.com/devtools/dev_api.html interactive demonstration page]'''. This page is connected to a specific demonstration instance that contains sample data for testing.
  
If you want to review how the API works and interact with some sample functions and test data be sure to visit the '''[https://api.smartsimple.com/devtools/dev_api.html interactive demonstration page]'''.  This page is connected to a specific demonstration instance that contains sample data for testing.
 
 
====[https://api.smartsimple.com/devtools/dev_api.html Interactive Demonstration Page]====
 
====[https://api.smartsimple.com/devtools/dev_api.html Interactive Demonstration Page]====
 
+
==Configuring JSON Functions within SmartSimple==
== Configuring JSON Functions within SmartSimple ==
+
The only functions you will be able to use within a instance of SmartSimple are the specific functions that have been enabled in that instance. Visit the article [[Creating JSON functions]] to learn how to add functions to your instance.
 
 
The only functions you will be able to use within a instance of SmartSimple are the specific functions that have been enabled in that instance. Visit the article [[Creating JSON functions]] to learn how to add functions to your instance.
 
  
 
==Field List Syntax==
 
==Field List Syntax==
Line 84: Line 82:
 
* levelthree.types
 
* levelthree.types
 
* levelthree.types.fields
 
* levelthree.types.fields
 +
 +
==Behavior of Template Formulas and Workflows==
 +
* Any template formulas that may exist will be executed for the added/selected record type and item/level
 +
* Workflows that may exist will be triggered
  
 
==See Also==
 
==See Also==

Revision as of 18:08, 23 November 2017

Introduction

SmartSimple’s SmartConnect JSON API provides a relatively easy to use method of integrating SmartSimple information with other web services and other programs.

The API uses industry standard JSON syntax and constructs. If you are not familiar with JSON you should take a look at the following tutorial before venturing much further in this topic:

SmartSimple System Version

Clients must be on the November 2015 or a more recent upgrade to use the API.

General Overview of the API

In order to use the API you will take the following steps:

  • Within your instance of SmartSimple you will create one or more API functions that can be called through the API.
  • Each function you create is linked to a specific SmartSimple object such as Organization, Contact, Report, Universal Tracking Application Level 1 object, Level 2 and level 3.
  • You define the fields that can be retrieved from that object through that function. This approach ensures that you never expose data to the API that you don't want people to use in the API.
  • You choose the Action Type that you wish to use for the function. Currently there are five action types:
    • Get - Retrieve a single record for the object type you have selected in the function.
    • List - Retrieve multiple records or the object type you have selected in the function.
    • Update - Change data in one or more fields in the object you have retrieved. Update is also used to create new objects.
    • Download File - Downloads to the browser a file you have retrieved.
    • List Files - Retrieves a list of files from a specified object.
    • Search Files - Retrieve a list of files containing specific string values.
  • Once saved, each function will generates and display a key that is unique to that function in that instance. You cannot use the function unless you supply the key.

Note: SmartSimple will increase the Action Types as we continue to enhance the API.

JSON API Interactive Demonstration Page

If you want to review how the API works and interact with some sample functions and test data be sure to visit the interactive demonstration page. This page is connected to a specific demonstration instance that contains sample data for testing.

Interactive Demonstration Page

Configuring JSON Functions within SmartSimple

The only functions you will be able to use within a instance of SmartSimple are the specific functions that have been enabled in that instance. Visit the article Creating JSON functions to learn how to add functions to your instance.

Field List Syntax

Field List Syntax Example
Separate values with ";;" sf_Name;;cf_MyFieldName
Prefix Standard fields with "sf_" sf_Name
Prefix Custom fields with "cf_" cf_MyFieldName  or  cf_MyFieldssid
Application Metadata append with "." followed by what you want returned levelone.status or levelone.* (star returns all)

Application Metadata Options:

Level One Options

  • *
  • levelone.*
  • levelone.fields
  • levelone.roles
  • levelone.categories
  • levelone.statuses
  • levelone.types
  • levelone.types.fields

Level Two Options

  • leveltwo.*
  • leveltwo.fields
  • leveltwo.types
  • leveltwo.types.fields
  • leveltwo.status

Level Three Options

  • levelthree.*
  • levelthree.fields
  • levelthree.types
  • levelthree.types.fields

Behavior of Template Formulas and Workflows

  • Any template formulas that may exist will be executed for the added/selected record type and item/level
  • Workflows that may exist will be triggered

See Also

Creating JSON functions
JSON API (SmartConnect) Prerequisite
JSON API (SmartConnect) Standard Field Names
API Sample Code