Skip to content

Commit d021dd3

Browse files
authored
🌿 (chore): update readme to include async client support (#86)
1 parent 53eba83 commit d021dd3

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

README.md

+30-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,31 @@ client.hris. # APIs specific to the HRIS Category
3939

4040
## Usage
4141

42-
## Create Link Token
42+
### Async Client
43+
The SDK also exports an async client so that you can make non-blocking
44+
calls to our API. This client leverages `httpx`'s AsyncClient, and exports all the same functions and functionality of the sync client.
45+
46+
```python
47+
import asyncio
48+
from merge.client import AsyncMerge
49+
50+
client = AsyncMerge(
51+
api_key="<YOUR_API_KEY>",
52+
account_token="<YOUR_ACCOUNT_TOKEN>")
53+
54+
async def main() -> None:
55+
await merge_client.ats.link_token.create(
56+
end_user_email_address="[email protected]",
57+
end_user_organization_name="acme",
58+
end_user_origin_id="1234",
59+
categories=[CategoriesEnum.ATS],
60+
link_expiry_mins=30,
61+
)
62+
63+
asyncio.run(main())
64+
```
65+
66+
### Create Link Token
4367

4468
```python
4569
import merge
@@ -61,7 +85,7 @@ link_token_response = merge_client.ats.link_token.create(
6185
print("Created link token", link_token_response.link_token)
6286
```
6387

64-
## Get Employee
88+
### Get Employee
6589

6690
```python
6791
import merge
@@ -75,7 +99,7 @@ employee = merge_client.hris.employees.retrieve(
7599
id="0958cbc6-6040-430a-848e-aafacbadf4ae")
76100
```
77101

78-
## Get Candidate
102+
### Get Candidate
79103

80104
```python
81105
import merge
@@ -89,7 +113,7 @@ candidate = merge_client.ats.candidates.retrieve(
89113
id="521b18c2-4d01-4297-b451-19858d07c133")
90114
```
91115

92-
## Filter Candidate
116+
### Filter Candidate
93117

94118
```python
95119
import merge
@@ -105,7 +129,7 @@ candidates_response = merge_client.ats.candidates.list(
105129
print(candidates_response.results)
106130
```
107131

108-
## Get Contact
132+
### Get Contact
109133

110134
```python
111135
import merge
@@ -119,7 +143,7 @@ contact = merge_client.accounting.contacts.retrieve(
119143
id="c640b80b-fac9-409f-aa19-1f9221aec445")
120144
```
121145

122-
## Create Ticket
146+
### Create Ticket
123147

124148
```python
125149
import merge

0 commit comments

Comments
 (0)