-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add configuration documentation (#816)
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Configuration | ||
============= | ||
|
||
- [URLs configuration](#urls-configuration) | ||
- [Base URL](#base-url) | ||
- [Account URL](#account-url) | ||
- [Upload URL](#upload-url) | ||
- [Timeout](#timeout) | ||
|
||
URLs configuration | ||
------------------ | ||
|
||
### Base URL | ||
The default base URL used for making API calls to Box can be changed by calling `SetBoxApiHostUri()` method. Default value is https://api.box.com/. | ||
|
||
```c# | ||
var customUri = new Uri("https://custom-api-url.com"); | ||
|
||
var boxConfig = new BoxConfigBuilder("clientID", "clientSecret") | ||
.SetBoxApiHostUri(customUri) | ||
.Build(); | ||
``` | ||
|
||
### Account URL | ||
The default account URL used to create OAuth authorization URL can be changed by calling `SetBoxAccountApiHostUri()` method. Default value is https://account.box.com/api/. | ||
|
||
```c# | ||
var customUri = new Uri("https://custom-account-url.com"); | ||
|
||
var boxConfig = new BoxConfigBuilder("clientID", "clientSecret") | ||
.SetBoxAccountApiHostUri(customUri) | ||
.Build(); | ||
``` | ||
|
||
### Upload URL | ||
The default URL used for uploads can be changed by calling `SetBoxUploadApiUri()` method. Default value is https://upload.box.com/api/. | ||
|
||
```c# | ||
var customUri = new Uri("https://custom-upload-url.com"); | ||
|
||
var boxConfig = new BoxConfigBuilder("clientID", "clientSecret") | ||
.SetBoxUploadApiUri(customUri) | ||
.Build(); | ||
``` | ||
|
||
Timeout | ||
------- | ||
|
||
The default request timeout can be changed by calling `SetTimeout()` method. Default timeout is 100 seconds. | ||
|
||
```c# | ||
var timeout = TimeSpan.FromSeconds(200); | ||
|
||
var boxConfig = new BoxConfigBuilder("clientID", "clientSecret") | ||
.SetTimeout(timeout) | ||
.Build(); | ||
``` |