Changes

Jump to: navigation, search

SmartConnect - RESTful API

774 bytes added, 14:24, 20 June 2023
API User Access Tokens
||<nowiki>https://example.smartsimple.com/API/1/transactions/</nowiki>
|}
 
<!--1136148 - SmartConnect API version 2-->
As of August 2022 upgrade, APIVersion=2 is now available. This version has standardized syntax and format of requests and responses.
===Message Body===
: '''''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'))
: criteria: [{ "andor": "(", "field": "cf_somefield1", "operator": "like", "value": "whatever" },{ "andor": "or", "field": "cf_somefield2", "operator": "like", "value": "whatever" },{ "andor": "or", "field": "cf_somefield3", "operator": "like", "value": "whatever" },{ "andor": "or", "field": "cf_somefield4", "operator": "like", "value": "whatever" },{ "andor": ") and (", "field": "cf_someotherfield1", "operator": "=", "value": "whatever" },{ "andor": "or", "field": "cf_someotherfield2", "operator": "=", "value": ""whatever else" }]
: sortby: 
: othersettings : {"getstorevalue":"0","keyformat":"0"}
* If updating, ensure the recordid is correct.
* Ensure the post endpoint URL is pointing to the correct resource.
 
 
Error and status messages vary from different API calls and are based on the records in the API calls. 
 
Other generic error messages on failed API request:
 
"Invalid API Token"<br />"Number of API Calls within the hour have reached the maximum limit, please try again later"<br />"Invalid URL: URL should start with https://."<br />"Invalid API Request, request is empty or null"<br />"Encountered error while processing other setting parameters"<br />"Encountered error while processing record"<br />"Encountered error while processing list"<br />"Recordset does not exist"<br />"Requested record does not exist"<br />"No records"<br />"SmartConnect API function configuration error, association type missing from Field List of function"<br />"Invalid record id"<br />"No content or empty content argument provided."<br />"No objectid argument provided."<br />"No object type argument provided."<br />"Consumer Provider link not configured in SmartConnect API settings"<br />"Requested field does not match with the object type"<br />"Requested field not found"<br />"Requested list does not have field list defined"<br />"You do not have permission to view this report."<br />"Search keywords can not be empty"
=Configuration - Advanced=
===API User Access Tokens===
You can use user access tokens for authentication instead of providing username + password in your API call. To create user access tokens for API users, got to SmartConnect API - API Users (tab), click into an API user in the list and click the Generate New Token button.
[[File:GenerateUserToken.png|thumb|none|1300px|Generate user access token for API user.]]
 
 
 
Use the token in Authorization header as: Bearer xxxxxxxxxxxx in your API call. This will replace the username and password in your API call.
 
[[File:BearerUserToken.png|thumb|none|1000px|Example call in Postman.]]
 
=Appendix=
==Standard Field Names==
<!--125991 - Throttle API calls-->
API calls in excess of 1000 per instance within the past hour will receive an error and blocked from using API until the total API calls count in the last hour drops below the limit.
==Error Messages==
Error and status messages vary from different API calls and are based on the records in the API calls. 
 
Other generic error messages on failed API request:
 
"Invalid API Token"<br />"Number of API Calls within the hour have reached the maximum limit, please try again later"<br />"Invalid URL: URL should start with https://."<br />"Invalid API Request, request is empty or null"<br />"Encountered error while processing other setting parameters"<br />"Encountered error while processing record"<br />"Encountered error while processing list"<br />"Recordset does not exist"<br />"Requested record does not exist"<br />"No records"<br />"SmartConnect API function configuration error, association type missing from Field List of function"<br />"Invalid record id"<br />"No content or empty content argument provided."<br />"No objectid argument provided."<br />"No object type argument provided."<br />"Consumer Provider link not configured in SmartConnect API settings"<br />"Requested field does not match with the object type"<br />"Requested field not found"<br />"Requested list does not have field list defined"<br />"You do not have permission to view this report."<br />"Search keywords can not be empty"
=SmartConnect Examples=
Smartstaff
119
edits

Navigation menu