Changes

API Sample Code

2,214 bytes added, 16:29, 5 September 2017
Added Retrieve Note section
=Sample Code from JSON API (SmartConnect)=
The following are excerpts from SmartConnect, SmartSimple's RESTful JSON API. To review how the JSON API works in greater detail, 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 webpage is connected to a specific demonstration instance that contains sample data for API testing.
'''<big><big>[https://api.smartsimple.com/devtools/dev_api.html Interactive Demonstration Page]</big></big>'''
 
==Get a Company Record==
===Request Code===
<pre>----------HTTP POST Request----------
===Response Code===
<pre>{
message: {},
records: [
==Get a Contact Record==
===Request Code===
<pre>----------HTTP POST Request----------
==Get a List of Organizations==
===Request Code===
<pre>----------HTTP POST Request----------
===Response Code===
<pre>{
message: {},
records: [
==Get a List of Contacts==
===Request Code===
<pre>----------HTTP POST Request----------
==Get a Meta Data from a UTA==
===Request Code===
<pre>----------HTTP POST Request----------
</pre>
===Response Code===
<pre> {
hassubactivity: false,
message: {},
] }, levelthree: {}, hasactivity: true}
</pre>
 
==Retrieving notes from an object==
Replace the URL accordingly depending on the type of object. The Objectid parameter is the ID of the record you wish to retrieve notes from.
 
/API/1/levelone/
 
/API/1/leveltwo/
 
/API/1/levelthree/
 
/API/1/user/
 
/API/1/company/
 
===Request Code===
This example below retrieves notes from a Level One object with an objectid of "1136627".  
The criteria filter restricts the note type returned where sf_Type equals to "Staff Note".
 
<pre>----------HTTP POST Request----------
 
Parameters (case sensitive)
url: "/API/1/levelone/"
*companyid : 825646
*alias : api
*username : smartconnectdemo@smartsimple.com
*password : *****************
 
 
apitoken : cmFgDAIDbHFaWB9jfmsCXQRAXw5mYGlXDggF@C2JAWXVuAjIF
 
 
--Begin custom parameter (replace '{parameter}' with actual value)--
--End custom parameter--
 
 
*Only required if calls are orginated from remote server
 
 
----------Jquery Ajax Request----------
 
 
function api_call() {
request = $.ajax(
 
 
{ url: "/API/1/levelone/",
 
 
{type: "POST",
data: {
apitoken: "cmFgDAIDbHFaWB9jfmsCXQRAXw5mYGlXDggF",
objectid: "1136627",
criteria: JSON.stringify([{"andor":"and","field":"sf_Type","operator":"like","value":"Staff Note"}]),
},
dataType: "html"
});
request.done(function( data )
{ //TODO
});
}
}
</pre>
===Response Code===
<pre>"{"message":{
 
},
"records":[
{
"sf_Type":"Internal Notes",
"sf_Content":"option1",
"sf_Type ID":"45377",
"sf_Note ID":"2246482",
"sf_Object ID":"1136627",
"sf_Created By":"SmartSimple",
"sf_Created Date":"2016-08-29 15:58:08",
"recordid":"2246482"
},
{
"sf_Type":"Internal Notes",
"sf_Content":"option2",
"sf_Type ID":"45377",
"sf_Note ID":"2246483",
"sf_Object ID":"1136627",
"sf_Created By":"SmartSimple",
"sf_Created Date":"2016-08-29 15:58:12",
"recordid":"2246483"
},
{
"sf_Type":"L1 Only UTA - 2 and All",
"sf_Content":"option3",
"sf_Type ID":"54302",
"sf_Note ID":"2246484",
"sf_Object ID":"1136627",
"sf_Created By":"SmartSimple",
"sf_Created Date":"2016-08-29 15:58:17",
"recordid":"2246484"
}
],
"header":[
 
]
}"
</pre>
 
==Additional SmartConnect API Sample Code==
'''<big><big>[https://api.smartsimple.com/devtools/dev_api.html Interactive Demonstration Page]</big></big>'''
 
The following are excerpts of SmartSimple's Deprecated Desktop API code written in Microsoft Visual Basic:
<pre> Dim ss_param As New SmartComClient.Parameters
Call ss_param.addField("opportunityid", "0")
</pre>
<pre>Option Explicit
Dim SmartSimple As New SmartComClient.Toolkit
0
edits