Skip to content

Commit

Permalink
(doc) improve code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Aug 15, 2022
1 parent fb37575 commit 063e4ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ When you have the API key and secret, you can instantiate a 'connection info' ob
var apiKey = "... your API key ...";
var apiSecret = "... your API secret ...";
var connectionInfo = new JwtConnectionInfo(apiKey, apiSecret);
var zoomClient = new ZoomClient(connectionInfo);
```

> **Warning:** <a href="https://marketplace.zoom.us/docs/guides/build/jwt-app/jwt-faq/">Zoom has announced</a> that this authentication method would be obsolete in June 2023. The recommendation is to swith to Server-to-Server OAuth.
Expand Down Expand Up @@ -93,6 +94,7 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, authorizati
Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User);
Environment.SetEnvironmentVariable("ZOOM_OAUTH_ACCESSTOKEN", newAccessToken, EnvironmentVariableTarget.User);
});
var zoomClient = new ZoomClient(connectionInfo);
```

> **Warning:** This sample I just provided can be used only when Zoom issues a new the autorization code. ZoomNet will take care of converting this code into an access token at which point the autorization code is no longer valid.
Expand All @@ -109,6 +111,7 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, refreshToke
Environment.SetEnvironmentVariable("ZOOM_OAUTH_REFRESHTOKEN", newRefreshToken, EnvironmentVariableTarget.User);
Environment.SetEnvironmentVariable("ZOOM_OAUTH_ACCESSTOKEN", newAccessToken, EnvironmentVariableTarget.User);
});
var zoomClient = new ZoomClient(connectionInfo);
```

#### Connection using Server-to-Server OAuth
Expand Down Expand Up @@ -137,18 +140,12 @@ var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, accountId,
a null value in lieu of a delegate.
*/
});
var zoomClient = new ZoomClient(connectionInfo);
```

The delegate being optional in the server-to-server scenario you can therefore simplify the connection info declaration like so:

```csharp
var connectionInfo = new OAuthConnectionInfo(clientId, clientSecret, accountId, null);
```


### Client

You declare your client variable like so:
```csharp
var zoomClient = new ZoomClient(connectionInfo);
```
18 changes: 9 additions & 9 deletions Source/ZoomNet.IntegrationTests/TestsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ public async Task<int> RunAsync()
// These are the integration tests that we will execute
var integrationTests = new Type[]
{
typeof(Accounts),
typeof(Chat),
typeof(CloudRecordings),
typeof(Contacts),
typeof(Dashboards),
typeof(Meetings),
typeof(Roles),
//typeof(Accounts),
//typeof(Chat),
//typeof(CloudRecordings),
//typeof(Contacts),
//typeof(Dashboards),
//typeof(Meetings),
//typeof(Roles),
typeof(Users),
typeof(Webinars),
typeof(Reports)
//typeof(Webinars),
//typeof(Reports)
};

// Get my user and permisisons
Expand Down

0 comments on commit 063e4ef

Please sign in to comment.