Syncro REST API - Build Custom Extensions/Apps/Add-ons
Table of Contents
Note: This document has been imported from the former KB and has not yet been verified.
Our API is very simple, it is RESTful, which means it is centered around data and simple operations to manage the data. Our API documentation uses Swagger which allows you to easily create and test our various web requests.
We have documented more than 30 API entities, like Ticket, Estimate, Appointment, etc. to be used.
Set Up
To get set up with our API Docs, follow these steps.
Obtain an API key
- If you already have a Syncro API key handy, copy it and skip to the next set of steps.
- Otherwise, follow these steps to generate one.
- Go to More > Admin > API - API Tokens.
- In the upper right, click New Token.
- Click the Custom Permissions tab.
- Give it a Name.
- Optionally enter an Expiration date.
- Turn on the permissions you want to use.
- Click Create API Token.
- Copy the key and save it someplace secure, as you won't be able to see it within Syncro again.
- Click Done.
See API Tokens for more information.
Authorize Swagger
- Go to Swagger API Docs: https://api-docs.syncromsp.com/. Alternatively, you can access Swagger by navigating to Admin > API - Documentation.
- Under Server variables, enter your Syncro subdomain.
- Click Authorize.
- In the Value field, paste your API key you generated or obtained in the prior set of steps.
- Click Authorize, then click Close.
You are now ready to use Swagger.
Use API docs
Once you have authorized your subdomain on the Swagger API docs, follow these steps to use them.
Warning: This connects to and can modify your actual site data, so be careful with Delete, Post and Put commands.
- Click any web request to view its details and any required parameters. Some do not require any.
- Click Try it out.
- Enter the parameters, if any. Note: "(query)" is not an actual SQL query, but simply refers to parameters you enter that the system will use to assemble a query. In the above screenshot, the first parameter you enter, as an integer, is a customer ID to request a specific customer.
- Click Execute to run the request.
- Swagger will show you if the request was successful and the response, along with several details.
- A cURL that can be used from the command line or code to get the same response you see in Swagger.
- Request URL: Put this in the address bar and append your API key to load the results there. Here are two examples, where you replace yoursubdomain with your Syncro subdomain and APIKEY with your actual key. Note that "?apikey=" must come before any other parameters.
https://yoursubdomain.syncromsp.com/api/v1/contacts?api_key=APIKEY&?customer_id=22040879&page=1
https://yoursubdomain.syncromsp.com/api/v1/tickets/44050842?api_key=APIKEY - Response Code. See the Responses section (f) for an explanation of the code.
- Response body: The results of the request. Click Download to download a JSON text file of the response body.
- Response headers: The header results of the request.
- Explanation of response codes and an example of what successful results will look like.
FAQ
Q: What's the API Rate Limit?
A: 180 requests per minute (per IP address).
Q: How do I access the JSON data?
A: https://api-docs.syncromsp.com/swagger.json