Get - Schwenkner/SugarSyncNet GitHub Wiki
The Http Get request is used to get Information upon CollectionContents or Files from SugarSync service.
The Get / GetAsync is a templated method to specify the response.
public T Get<T>(string url)
public async Task<T> GetAsync<T>(string url)
The URL is the reference of the
- [CollectionContents] (CollectionContents)
- [Collection] (Collection) or
- [File] (File)
to get the Information from.
Responses can be of type
- [CollectionContents] (CollectionContents)
- [User] (User)
- [Folder] (Folder)
- [File] (File)
// instantiate SugarSync client
Client client = new Client("API key", "API private", "application Id");
// Login with existing refresh token
client.UserLogin = new UserLogin("refreshToken");
// get user's workspaces
User user = await client.GetAsync<User>(Client.SugarSyncUrl + "user");
// get contents of the sync folder collection
CollectionContents collectionContents = await client.GetAsync<CollectionContents>(user.SyncFolders);