Skip to content

Commit

Permalink
docs: add configuration documentation (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwwoda authored Apr 19, 2022
1 parent bbbd93f commit 73792a5
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions docs/configuration.md
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();
```

0 comments on commit 73792a5

Please sign in to comment.