Question: I have an asp.net web application where I am trying to upload tracks on Soundcloud using this method: [Connecting to and uploading tracks with Soundcloud API using C# .NET](https://stackoverflow.com/questions/11892440/connecting-to-and-uploading-tracks-with-soundcloud-api-using-c-sharp-net)

I created an app on soundcloud but I don't know how to generate my oauth token [oauth\_token]

Thanks

Answer: 
The oauth token is something you get per user after they authorize your app. For server-side web applications, you use the API credentials for your app to redirect the user to the SoundCloud authorization URL so they can login and approve your request. 

When they approve your authorization request, they are sent to the `redirect_uri` you specified when registering your app. There is a code in this response (`code` in the querystring) that you will exchange for the oauth token you want (in this case its called `access_token`). Then you need to save off that `access_token` (associated with that user).

I recently created a SO post with `C#` code detailing how to do this: [How to let users login to my site using SoundCloud](https://stackoverflow.com/questions/14973017/how-to-authenticate-soundcloud-via-oauth2). You can also use this as an authentication method for your website (also what the post is about).
You don't generate it on yourself, you get it from the SoundCloud API. You have first to authorize with your client\_id, client\_secret and a redirect\_url then in the redirect\_url (which the soundcloud server will call it should be some script on your server) you can get the token from the GET parameter "code". Then in the next step you can exchange the code for an access token.

Here is their example code in PHP:

```
<?php
// start.php
require_once 'Services/Soundcloud.php';

// create client object with app credentials
$client = new Services_Soundcloud('CLIENT_ID', 'CLIENT_SECRET', 'REDIRECT_URL');

<?php
// callback.php
// exchange authorization code for access token
$code = $_GET['code'];
$access_token = $client->accessToken($code);

```