Getting Started
This page outlines how to use our SDKs to interact with our API. Specifically, you’ll learn how to make a request to create an Encounter.
SDK Information
- Python:
- Repository: candidhealth-python
- Artifact: candidhealth
- TypeScript/JavaScript:
- Repository: candidhealth-node
- Artifact: @candidhealth
- Ruby:
- Repository: candidhealth-ruby
- Artifact: candidhealth
- .NET:
- Repository: candidhealth-csharp
- Artifact: Candid.Net
If your language of choice is not yet supported, you can still use our API by making requests directly to our REST endpoints. For further questions or to ask for additional language support, please reach out to our Support team.
Prerequisites
- Python 3, Node, or Ruby 2.7+ installed on your system
- Candid Client ID
- Candid Client Secret
Installation
First, install the SDK using your package manager:
Authentication
To make requests to our API, you’ll need to use your API key for authentication. Initialize the SDK as follows:
Candid provides two environments, staging and production. Take care to pass the correct environment when creating your API client so that requests are routed correctly. Be sure to not send PHI to the staging environment.
Making an Example Request
In this example, we’ll create an Encounter using the V4 API.
Error Handling
Each endpoint in our SDK documents which errors and exceptions can be raised if the request fails. These can be caught and handled via native exception-handling:
Rate Limiting
Requests to the Candid API are rate-limited by IP. Each IP is allowed 1000 requests within a 10-second rolling window.
If an IP exceeds its limit, the API will respond with HTTP 429 - Too Many Requests
. If this occurs, it is recommended
that the client retry the request with exponential backoff logic to reduce request volume density. Exponential backoff logic is already implemented inside the Candid Health SDKs.