SharpSpring API allows your application to connect to the internal CRM functionality of SharpSpring. Our current implementation involves features such as:
- Creating and Updating Leads (including custom fields)
- Integrating with the Automation Engine via lead field change events (this is automatic)
- Creating, updating, and retrieving Campaigns, Accounts, and Opportunities
Creating API Keys
In order to access the SharpSpring API, you must generate both an account ID and an API key. Our API currently does not support sessions, so these keys must be supplied during each request.
Click here to generate your API key.
Request & Response Format
Once your keys have been generated, you can begin creating your mechanism to retrieve and post data to and from the SharpSpring application. All requests are made using an HTTPs POST encoded in JSON. We use a standard very similar to JSON-RPC for request handling.
Requests must be made to the following URL:
Authentication parameters must be appended to the URL as query strings, for example:
Each request must contain the following three fields:
method - the name of the API method being called
params - a parameters hash to be passed to the method
id - a user-supplied requestID for correlating requests
Each API response contains the following three fields:
result - The return value of the method called. Usually a list of Objects and Object-level errors
error - An API-Level error returned by the API
id - A user-supplied request ID for correlating requests
- For more information about methods and parameters, please view the methods section of the API documentation.
- For example code, please view the examples section of the API documentation.
- The API schema is available in the schema section of the API documentation.
- Additional information about the API error codes can be found here.
API Usage Limitations
Each SharpSpring partner is currently allotted 5,000 API Requests per day by default with a maximum of 500 queries per request. Requests may be rate limited in times of high traffic. The amount of API requests is subject to change in the future.
502 Error - Disabling Expect:100-continue Header
If you experience a 502 error when running a call, check to see if Expect:100-continue is enabled in the header. SharpSpring uses Google's GCE service, and when the Expect:100-continue header is enabled API calls longer than 1024 characters (including the secret key and other data) will result in a 502 error. This option is on by default in .NET as well as PHP.
Disabling Expect:100-continue for .NET
Run the following lines prior to the API call:
Disabling Expect:100-continue for PHP
To disable Expect:100-continue in Curl within PHP, add the 'Expect" option to the HTTPHEADER section with no value. Refer to the last line in the area below for an example of how to disable Expect:100-continue in PHP with this method.