Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cburnette committed Nov 5, 2015
1 parent 83c2bd4 commit 912a9eb
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var userDetails = await userClient.UsersManager.GetCurrentUserInformationAsync()
#### Configure
Set your configuration parameters and initialize the client:
```c#
var config = new BoxConfig(<Client_Id>, <Client_Secret>, "https://boxsdk");
var config = new BoxConfig(<Client_Id>, <Client_Secret>, <Redirect_Uri>);
var client = new BoxClient(config);
```

Expand Down Expand Up @@ -97,15 +97,7 @@ var client = new BoxClient(config, session);
#### Get Folder Items
```c#
// Get root folder with default properties
BoxFolder f = await client.FoldersManager.GetItemsAsync("0", 50, 0);

// Get root folder with specific properties
BoxFolder f = await client.FoldersManager.GetItemsAsync("0", 50, 0, new List<string>() {
BoxFolder.FieldModifiedAt,
BoxItem.FieldName,
BoxFolder.FieldItemCollection,
BoxFolder.FieldPathCollection
});
var items = await client.FoldersManager.GetFolderItemsAsync("0", 500);
```

#### Get File Information
Expand Down Expand Up @@ -142,6 +134,12 @@ BoxFile f = await client.FilesManager.UploadAsync(request, stream);
Stream stream = await client.FilesManager.DownloadStreamAsync(fileId);
```

#### Get Temporary Download Uri for a file
This method will retrieve a temporary (15 minute) Uri for a file that can be used, for example, to send as a redirect to a browser, causing the browser to download the file directly from Box.
```c#
var downloadUri = await client.FilesManager.GetDownloadUriAsync(fileId);
```

#### Search using Metadata
```c#
var filter = new
Expand All @@ -161,6 +159,19 @@ var mdFilter = new BoxMetadataFilterRequest()
var results = await client.SearchManager.SearchAsync(mdFilters: new List<BoxMetadataFilterRequest>() { mdFilter });
```

#### Make API calls with As-User
If you have an admin token with appropriate permissions, you can make API calls in the context of a managed user. In order to do this you must request Box.com to activate As-User functionality for your API key (see developer site for instructions).
```c#
var config = new BoxConfig(<Client_Id>, <Client_Secret>, <Redirect_Uri);
var auth = new OAuthSession(<Your_Access_Token>, <Your_Refresh_Token>, 3600, "bearer");

var userId = "12345678"
var userClient = new BoxClient(config, auth, asUser: userId);

//returns root folder items for the user with ID '12345678'
var items = await userClient.FoldersManager.GetFolderItemsAsync("0", 500);
```

File/Folder Picker
------------------
The Box Windows SDK includes a user control that allows developers an easy way to drop in a file and or folder picker in just one line of code
Expand Down

0 comments on commit 912a9eb

Please sign in to comment.