Changes

SmartConnect - RESTful API

2,008 bytes added, 20:57, 22 June 2018
no edit summary
Here is a more detailed look at [[Using JSON functions|using SmartConnect functions]].
<pre>Sample call within SmartSimple instance:
 
function api_call() {
$.ajax({
method: "POST",
type: "POST",
url: "/API/1/levelone/",
data: {
apitoken: "QlwYYlJERHVASmlfXWtTWklbXEt9UHpmDw4~",
recordid: 1234567,
},
dataType: "html"
})
.done(function(data) {
json = JSON.parse(data);
});
}
</pre>
 
 
<pre>Sample Remote call:
 
function api_call() {
$.ajax({
method: "POST",
type: "POST",
url: "/API/1/levelone/",
data: {
username: username,
password: password,
companyid: 825646,
alias: api
apitoken: "QlwYYlJERHVASmlfXWtTWklbXEt9UHpmDw4~",
recordid: 1234567,
},
dataType: "html"
})
.done(function(data) {
json = JSON.parse(data);
});
}
</pre>
 
 
===POST Response===
With every successful request a HTTP status of 200 is returned along with a JSON response body that contains the record field data.
 
For record Updates and creation, the response body will return the Record ID and a status of "Updated Successfully".
 
<pre>Sample Response format for Update:<br />
{
"records":[
{
"recordid":"6048788",
"recordindex":1,
"status":"updated successfully"
}
],
"message":{
 
}
}
</pre>
 
<pre>Sample Response format for GET/LIST based on configured field list:
 
{
"records":[
{
"sf_Description":"0959-3985",
"sf_Transaction ID":"6048788",
"sf_Created Date":"2015-07-23 11:03:17",
"sf_End Date":"2015-07-23 11:03:17",
"sf_Subject":"API Test",
"sf_Object ID":"0",
"sf_Start Date":"2015-07-22 00:00:00",
"sf_Modified Date":"2018-05-09 11:14:58",
"sf_Type":"Publications",
"sf_Created By":"SmartSimple Support",
}
],
"message":{
 
}
}
</pre>
 
===Error Messages===
==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:
0
edits