This page outlines how to use our Python and TypeScript/JavaScript 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
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: