How to use the API
Before you begin, do ensure you have purchased the API Access. API Access is not available as part of any plan and is an add-on that can be purchased by contacting your Account Manager. Let us show you how you can setup Access to Clinicea API.
1. Login into Clinicea using your admin account details
2. Goto Tools | Organization | Select an Organization. Scroll down to Preferences and click on “Integrations”.
3. On the “Integrations” window click on “Clinicea API”. The list of all API keys active for the organization will be available here.
One Organization can have multiple API keys. It is a good practice to give each software you integrate with Clinicea, a new API Key. This way in case you want to block access to a 3rd party software, you just need to delete 1 API key from the list below, while all of your other integrations will continue working as earlier.
3(a). If you want a new generate a new API Key, click on the add new button.
- Enter a “Name”.
- Select a “API Role” OR Select “Full Access”, depending on how much access to your data you want to give to the 3rd Party Software.
4. How to use the API Key and make API Calls – To be completed by your Developer
4(a). Use the API key that is obtained from the above mentioned Step 3.
- Goto the Clinicea API.
- Scroll to the top and place your API Key in the textbox next to the Explore button.
- Click on the Explore button.
- Navigate to any API method by selecting the API operation i.e “GET”,”POST”,”PUT”,”DELETE”.
- Fill in the input parameters according to their API Call documentation.
- Set the preferred Response Type for your Result.
- Click on “Try it Out”. This is what the output will look like.
5. Alternatively, you can also make API calls from some other tool:
From Curl you can do this:
curl -X GET –header “Accept: application/json” –header ‘api: db884629bc924b82a15fa23a0c3b9475’ “https://api.clinicea.com/api/v1/leads?startRange=20150321&endRange=20170321&intPageNo=2”
From Fiddler you can do this:
6. Important Points to be remembered while using the API calls
6(a). All the API calls have been designed to support an easy incremental Sync. Each API call supports a single parameter lastSyncTimestamp given in the standard ISO 8601 notation ex: 2015-03-21T14:30:10+0:00 .It will return all data that has been added, modified or deleted since the last sync. We have also added a new common property to all objects, DataStatusStr (None, Added, Modified, Deleted). It is readonly, and will guide you on how to sync your local database with the returned values based on your lastSyncDate.
Example: So to get the 3rd page you need to pass new query string called intPageNo=2