Skip to content

Commit 326c246

Browse files
authored
Update README.md
Updated README.md to have a basic sample.
1 parent e0ec3bd commit 326c246

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
# ClickUpAPI
22

3-
C# / .NET / .NET Core Implementation for management ClickUp API.
3+
C# / .NET / .NET Core Implementation for management ClickUp API.
4+
5+
## Sample Usage
6+
7+
For OAuth2 Flow - see https://jsapi.apiary.io/apis/clickup20/introduction/authentication.html and https://jsapi.apiary.io/apis/clickup20/reference/0/authorization/get-access-token.html
8+
9+
```
10+
var apitokens = new ParamsAccessToken(clientId, clientId, code);
11+
var api = ClickUpApi.Create(apitokens);
12+
var getTeamsResponse = api.GetAuthorizedTeams();
13+
if (getTeamsResponse.RequestStatus != HttpStatusCode.OK || !getTeamsResponse.ResponseSuccess.Teams.Any())
14+
throw new AuthorisationException("Could not find any teams you are part of.");
15+
```
16+
17+
For Personal Token - see https://jsapi.apiary.io/apis/clickup20/introduction/authentication.html
18+
19+
```
20+
var api = new ClickUpApi(personalToken);
21+
var getTeamsResponse = api.GetAuthorizedTeams();
22+
if (getTeamsResponse.RequestStatus != HttpStatusCode.OK || !getTeamsResponse.ResponseSuccess.Teams.Any())
23+
throw new AuthorisationException("Could not find any teams you are part of.");
24+
```

0 commit comments

Comments
 (0)