Webhooks and API integration with Video Call
Information for developers integrating external services with healthdirect Video Call
We are introducing a robust webhook system to make it possible to integrate external services with healthdirect Video Call. This allows health services to receive real-time events from the Video Call service, request more information and automate workflows efficiently.
Webhooks integration overview
- Installation: Email us at videocallsupport@healthdirect.org.au to gain access to the feature and documentation.
-
Authentication types:
- No Authentication
- Bearer token
- HTTP Basic Authentication
- OAuth 2.0
- Webhook Listener: Setup a secure listener on your side for receiving Webhooks notifications. Configure the listener details in CONFIGURE --> WEBHOOKS.
- Request More Information: POST a request with authentication tokens to receive more information about the session.
Diagram: Webhooks integration example
API Keys
To interact with the API, you will need a Client ID and Client Secret. Generate API keys from your Video Call profile and settings.
Getting Started
Below is an example code to get details of all the waiting callers in a waiting area, written in Python.
import requests
import base64
import os
from dotenv import load_dotenv
load_dotenv()
base_url = "https://api.covi-stage.io/v1/"
def get_headers():
return {
"accept": "application/json",
"authorization": f"Bearer {get_access_token()}"
}
def get_access_token():
url = f"{base_url}auth/token"
username = os.getenv("CLIENT_ID")
password = os.getenv("CLIENT_SECRET")
token = f"{username}:{password}"
payload = {"grant_type":"client_credentials"}
encoded = base64.b64encode(token.encode()).decode()
headers = {
"accept": "application/json",
"content-type": "application/x-www-form-urlencoded",
"authorization": f"Basic {encoded}"
}
response = requests.post(url, data=payload, headers=headers)
access_token = response.json()['access_token']
return(access_token)
def get_waiting_calls(team_id):
url = f"{base_url}waiting/{team_id}"
response = requests.get(url, headers=get_headers())
print(response.text)
Docs
To learn more about the project and access sample code, please visit our Gitlab page by clicking here.
Table of Contents