This project is read-only.

Authorizing a MVC Web application

Start Authorization
public ActionResult Authorize()
{
    var _soundCloud = new SoundCloud("your clientId");
    var redirectUrl = _soundCloud.GetAuthorizeUri(new Uri("http://somedomain.com/soundcloud/authorized"));

    return Redirect(redirectUrl.AbsoluteUri);
}

Finish Authorization
public async Task<ActionResult> Authorized(string code)
{
    var _soundCloud = new SoundCloud("your clientId");
    var token = _soundCloud.RequestOAuthToken(Request.Url, "your clientSecret");
    var me = await _soundCloud.Me.GetAsync();

    ViewBag.Message = string.Format("Your token: {0} {1}", token.access_token, me.username);

    return View("Details", me);
}

Users

// Get the authenticated user
var me = _soundCloud.Me.Get();

// Get a list of users
var users = _soundCloud.Users.Get();

// Get the second page of users
var users = _soundCloud.Users.Get(1);

// Get a specific user
var user = _soundCloud.Users[userId].Get();

// Get the tracks of a specific user
var tracks = _soundCloud.Users[userId].Tracks.Get();

// Get the favorites of a specific user
var favs = _soundCloud.Users[userId].Favorites.Get();

// Get a specific favorite of a specific user
var fav = _soundCloud.Users[userId].Favorites[favoriteId].Get();

// Put a favorite of a specific user
_soundCloud.Users[userId].Favorites[favoriteId].Put(fav);

// Delete a favorite of a specific user
_soundCloud.Users[userId].Favorites[favoriteId].Delete();

Groups

// Get a list of groups
var groups = _soundCloud.Groups.Get();

// Get the second page of groups
var groups = _soundCloud.Groups.Get(1);

// Get a specific group
var user = _soundCloud.Groups[groupId].Get();

// Get the moderator of a group
var moderator = _soundCloud.Groups[groupId].Moderators.Get();

// Get the contributers of a group
var contributers = _soundCloud.Groups[groupId].Contributors.Get();

// Get the members of a group
var members = _soundCloud.Groups[groupId].Members.Get();

// Get the tracks of a group
var tracks = _soundCloud.Groups[groupId].Tracks.Get();

// Get the pending tracks of a group
var tracks = _soundCloud.Groups[groupId].PendingTracks.Get();

// Get a specific pending track of a group
var tracks = _soundCloud.Groups[groupId].PendingTracks[trackId].Get();

// Put a pending track to a group
var tracks = _soundCloud.Groups[groupId].PendingTracks[trackId].Put();

// Delete a pending track from a group
var tracks = _soundCloud.Groups[groupId].PendingTracks[trackId].Delete();

Playlists

to be documented

Tracks

to be documented

Comments

to be documented

And lots more to be documented...

Last edited Feb 28, 2013 at 10:27 AM by Coilz, version 12

Comments

No comments yet.