Soundmate For Soundcloud 3 1 0

broken image


3 Secrets To Build Your Network While Maximizing Credits For Faster Growth The Secret Potion For Songs: Boost Your Growth In A Few Seconds With This Gain Fans 10 Times Faster After Applying These Slight Profile Changes. Sep 12, 2016 Get 3 Months of SoundCloud Go for $0.99 This Week. We're unveiling our best deal for SoundCloud Go ever – get your first 3 months for just $0.99. – but only for a limited time.

Using the SoundCloud API, you can build applications that takesound on the web to the next level. With this guide we explain andprovide code examples for many common integration use cases likeplaying and uploading sounds or how to take advantage of SoundCloud'smany social features. If you're looking for more in depth information,feel free to jump to our API Reference.

To help you get started quickly, SDKs are availablefor Python,Ruby,JavaScript. To follow along with theexamples below, you'll need to have at least one SDK installed.

Now go ahead and jump to the section you're most interested in and getstarted.

    Authentication
    Uploading Sounds
    Playing Sounds
    Follow & Like
    Search
    Pagination
    SoundCloud URLs
    Cross Domain Requests
    Errors

Authentication

This section presumes you have:

Our API allows you to get permission from a SoundCloud user toaccess SoundCloud on their behalf. This means that you will haveaccess to their account, including any private sounds or sets thatthey have created or have had shared with them. You can also use SoundCloudfor your app's registration and sign-in process. This creates a seamless,one click experience for your users and give your app aneasy way to upload sounds, make comments or otherwise act on auser's behalf.

SoundCloud authentication uses OAuth 2.0,a popular open standard used by many popular API providers. OAuth 2.0allows users to authorize your application without disclosing their usernameand password.

There are different ways to authenticate with OAuth, depending onthe type of application you're building. You can also simplify yourlogin process by using the Connect with SoundCloud buttons as yourapps login system.

In this section:

Sign in with SoundCloud

You can simplify your registration and sign in process by using aConnect with SoundCloud button. A text 2 35 5g. This lets your user know that theycan register for your app with one click using their SoundCloudaccount. It also grants your app access to their account and givesyou the ability to upload tracks, create sets and otherwise act ontheir behalf.

Client-side JavaScript Applications

If you are writing an application that runs in the browser, youshould use the JavaScript SDK SC.connect() method toauthenticate your app.

A pop-up window will be opened allowing the user to log in toSoundCloud and approve your app's authorization request. You'll haveto host the callback.htmlfile on your server and set the redirect_uri in your app settingsaccordingly.

Security Advice

Using the implicitOAuth authorization flow (response_type=token) is not recommended.It can suffer from access token leakage and accesstoken replay attacks. Use response_type=codeinstead.

Use the state parameter forCSRF protection. Pass a sufficient random nonce here and verify this nonce againafter retrieving the token.

Server-side Web Applications

To authenticate your server-side web application using one of ourSDKs, create an instance of the Soundcloud class withthe API credentials you obtained when you registered your app andredirect the user to the authorization URL so that they can log inand approve your request.

The user will be redirected to a SoundCloud connect screen andasked to authorize your application. If the user is already signedinto SoundCloud, they will be able to authorize your request in oneclick.

Users of your app will be redirected to the SoundCloud Connect screen.

If the user approves your authorization request, they will be sentto the redirect_uri you specified when registering your app. Extractthe code parameter from the query string and use it to obtain anaccess token.

Tvpaint animation 8 1. You should now store the access token in a database. Associate itwith the user it belongs to and use it from now on instead ofsending the user through the authorization flow. The returned objectwill have an access_token property and a refresh_tokenproperty as well as expires_in and scope.

3at1

Refreshing Tokens

You will need to periodically refresh your access tokens when they expire:

Mobile and Desktop Applications

You authenticate Mobile and Desktop Applications the same way youdo for Server-side Web Applications. To make the flow smoother, youcan use a redirect_uri with a custom protocol scheme and set yourapp as a handler for that protocol scheme. For example, yourredirect_uri could be something like my-app://soundcloud/callback.

When building apps for mobile devices, we recommend using ourmobile optimized connect screen by setting display=popupin the authorization URL query string.

Getting Information about the Authenticated User

Once the user has signed into SoundCloud and approved your app'sauthorization request, you will be able to access their profile andact on their behalf. We have provided a convenient endpoint foraccessing information about the authenticated user.

Authenticating without the SoundCloud Connect Screen

If you simply need an access token for testing, and do not want togo through the connect flow, or if you have one central account yourapp needs to access, you can use the OAuth User Credentials Flow. Anexample of this kind of app would be an artist's website whereyou'll only be using a single SoundCloud account for the artistssets, user information and sounds. In these cases you may exchange aset of user credentials for an access token.

Do not use this if you intend for users to access their SoundCloudaccounts from your app. Because this authorization flow depends onpassing a set of user credentials, it is inaccessible for anyone whohas used Facebook Connect to create their SoundCloud account. It isalso a bad practice to require users to give your app their usercredentials. If you intend to upload sounds from different users,you must use a more appropriate authentication flow, such as theones explained above.

Our Terms of Service specify that you mustuse the Connect with SoundCloud screen unless you have made a separatearrangement with us.

Uploading Sounds

3/1 Usmc

This section presumes you have:

Sounds (in the API these are called tracks) are core toSoundCloud. Our API gives you the ability to upload, manage andshare sounds on the web. Your app can take an audio file and uploadit to a user's SoundCloud account. You can also manage metadata(including tags), share the sound on other social networks, or addthe sound to playlists. We support the following formats: AIFF,WAVE, FLAC, OGG, MP2, MP3, AAC, AMR and WMA.

In this section:

Uploading Audio Files

To upload a sound, send a POST request with a multipart/form-datamedia type to the /tracksendpoint. This is done with one of our SDKs using the post methodand passing information about the track being uploaded.

Request bodies for track uploads via the API may not be larger than500MB.

If successful, your track will immediately be queued up forencoding. You check the state property of the track resource tocheck its progress. Once the state is finished it is ready to beembedded or streamed.

See also:

  • /tracks endpoint reference documentation.
  • Desktop sharing kits.
  • iOS sharing kit.
  • Android sharing kit.

Updating Metadata

In order to update a sounds metadata, you create a client and callthe put method, passing in the path of the track resource and theproperties you want to update.

You can update the track artwork using the artwork_data parameter.Please note that at this time it is not possible to update the actual track audiofile.

For a full list of properties that can be set on a sound resource,see the /tracks endpoint reference.

Sharing Sounds to other Social Networks

SoundCloud accounts can be connected to accounts on Twitter,Facebook, Foursquare and Tumblr to allow easy sharing of tracks andfavorites. On every public track your app uploads, you can choose toshare it to one of the connected social networks.

A list of networks that a user has connected to their account isavailable using the /me/connectionsendpoint. You can create new connections, and use existing connections toshare tracks and playlists using our API.

When you upload new sounds or create a new set, you canautomatically share to Twitter, Facebook or any other networkconnected to your apps users SoundCloud account.

You can also share an existing track or playlist.

See also:

  • /tracks endpoint reference documentation
  • /me/connections endpoint reference documentation

Creating Sets

Sets (in the API these are called playlists) allow you to organizesounds into groups that can be shared together. For example, songsin an album or a specific collection of sounds can be groupedtogether using a set and then shared to the world. You can only addsounds that you own to a set and a sound can belong to multiplesets.

You create sets using our API by creating a client and calling thepost method with the /playlistsendpoint and information about the set, including a list of track ids.

Adding Sounds to a Set

Once a set has been created, you can continue to add sounds to it byupdating the tracks property.

Accessing Sets

To get a list of tracks in a set, send a GET request to the/playlists endpoint with the set id.

See also:

  • /playlists endpoint reference documentation.

Playing Sounds

This section presumes you have:

Yep, you can also play sounds from your application. Depending onyour needs, you can embed a player widget, use the JavaScript SDK tostream audio content in the browser, or feed a stream url into yourown audio player. You can also use our Widget API to control theplayer and handle events.

In this section:

Embedding a SoundCloud Widget

If you have the URL of a sound or set, you can get the embedcode and paste it into your website. You can also do this inyour application using the oEmbed endpoint. Given a sound or setURL, you can retrieve all of the information you need to embed aplayer.

The JavaScript SDK has a shortcut for embedding a player widget. Inorder to embed a player widget using the JavaScript SDK, you cancall the SC.oEmbed() function, passing in the track or playlist URLand any options for the player. For full details, see ouroEmbed reference.

Example SoundCloud Widget

Streaming Sounds

Note if you are going to stream from our API you need to attribute properly. Make sure you've read our Terms and Attribution Guidelines to make sure you treat our creators content correctly. When using a custom player you must:

  1. Credit the uploader as the creator of the sound
  2. Credit SoundCloud as the source by including one of the logos found here
  3. Link to the SoundCloud URL containing the work
  4. If the sound is private link to the profile of the creator

If you don't want to use the SoundCloud widget, our API gives youthe ability to access a sound's stream URL and use your own playerto play sounds from SoundCloud. In order to get a URL for streaminga sound, you can request the appropriate resource and make note ofthe stream_url property. Send a GET request to that URL andyou will get a 302 - Found redirect, which you can intercept bypassing allow_redirects=False to the get method.

Note that as long as the sound is public, you'll only need toprovide a client_id when creating a client. If you would like toaccess the stream URL for a private sound, you'll need toauthenticate your app.

See also:

  • /oembed endpoint reference documentation.
  • HTML5 Widget API.
  • JavaScript SDK Streaming.
  • /tracks endpoint reference documentation.

This section presumes you have:

SoundCloud has many social features that make it easier tocollaborate, share and get feedback. The primary way that SoundCloudusers interact is by leaving comments on each other's sounds.

Our API allows you to leave comments on sounds by calling thepost method with the /tracks/{TRACK_ID}/comments path andinformation about the comment. Include the timestamp to make it atimed comment.

Note that you cannot leave comments on sounds if the creator hasdisabled comments.

Note that the timestamp value is in milliseconds and represents theamount of time from the beginning of the sound. If you omit thetimestamp, the comment will be a non-timed comment.

You can also get a list of comments for a specified sound.

See also:

  • /tracks endpoint reference documentation.

Follow & Like

This section presumes you have:

Your application can take advantage of SoundCloud's social featuresby allowing users to follow other users and like sounds or sets. Debookee 7 4 15. Followingand liking allows SoundCloud users to customize their experience. Soundscreated and reposted by people your user follows will be available in theiractivity feed.

You can follow a user using the /me/followings endpoint.

Liking a sound or set is done using the /me/favorites endpoint.

See also:

  • /me endpoint reference documentation.

Search

This section presumes you have:

Resources such as sounds, users, sets can be searchedusing our API. Most endpoints will accept a q param which you canuse to specify a keyword to search for in fields like title,username, description, etc. depending on the resource type.

Some resource types, such as sounds, can be filtered by fields likelicense, duration or tag_list.

You can also specify ranges for bpm, duration, and more.

For a complete list of search fields and filters, please see theAPI Reference for the resourcetype you'd like to search.

Pagination

For

This section presumes you have:

Most results from our API are returned as a collection. The numberof items in the collection returned is limited to 50 bydefault with a maximum value of 200. Most endpoints support alinked_partitioning parameter that will allow you to pagethrough collections. When this parameter is passed, the response willcontain a next_href property if there are additional results.To fetch the next page of results, simply follow that URI. If the responsedoes not contain a next_href property, you have reached theend of the results.

SoundCloud URLs

This section presumes you have:

If you have a permalink URL to a particular resource, but need moreinformation such as an ID or other property. In these cases, you canuse the /resolve endpoint to extract a full representation of theresource.

See also:

  • /resolve endpoint reference documentation.

Cross Domain Requests

This section presumes you have:

Our API supports CORS for making cross domain requests. This meansyou can access SoundCloud API endpoints from JavaScript running inthe browser. By requesting results formatted as JSON, you will beable to parse and use the response immediately.

We also support JSONP, which can be used by passing a callbackparameter in the query string of the URL you are requesting.

Errors

Soundmate For Soundcloud 3 1 0

This section presumes you have:

Most results from our API are returned as a collection. The numberof items in the collection returned is limited to 50 bydefault with a maximum value of 200. Most endpoints support alinked_partitioning parameter that will allow you to pagethrough collections. When this parameter is passed, the response willcontain a next_href property if there are additional results.To fetch the next page of results, simply follow that URI. If the responsedoes not contain a next_href property, you have reached theend of the results.

SoundCloud URLs

This section presumes you have:

If you have a permalink URL to a particular resource, but need moreinformation such as an ID or other property. In these cases, you canuse the /resolve endpoint to extract a full representation of theresource.

See also:

  • /resolve endpoint reference documentation.

Cross Domain Requests

This section presumes you have:

Our API supports CORS for making cross domain requests. This meansyou can access SoundCloud API endpoints from JavaScript running inthe browser. By requesting results formatted as JSON, you will beable to parse and use the response immediately.

We also support JSONP, which can be used by passing a callbackparameter in the query string of the URL you are requesting.

Errors

This section presumes you have:

When an error occurs, our API will return an appropriate HTTPstatus code and an error message description. Our SDKs will wrapthis in an exception that you can catch and choose how to handle.

HTTP Status Codes

Soundmate For Soundcloud 3 1 0 35

The response from SoundCloud will have an HTTP status code thatwill help you determine the cause of the error. Our API tries to usethe appropriate HTTP status code to indicate the type of problemencountered.

Below is an overview of what those codes mean, along with some suggestionsthat might help you fix things.

400 Bad Request

This is likely to be caused by a programming error on your part. Check the requirements of the endpoint you're calling in the HTTP API Reference.

401 Unauthorized

This means that we were not able to authenticate you based on the information provided in the request. Make sure you're sending a client_id or an access_token.

Our public endpoints will work by just providing a client_id. Acting on behalf of another user is different. The Authentication section gives a detailed explanation of how this works.

If you're connecting using OAuth, don't forget that tokens can expire. These will need to be refreshed. Not doing so can also result in getting a 401 error.

If you need to check your application's details, use the Your Applications page. This will include the client_id for your application.

403 Forbidden

You don't have access to whatever it is you're asking for.

404 Not Found

You're asking for something that doesn't exist. Check the URL that you're requesting.

406 Not Accessible

This means it wasn't possible to respond with the format you requested. Check the Accept header that you're sending.

422 Unprocessable Entity

The request was valid, but one or more of the parameters looks a little screwy. It's possible that you sent data in the wrong format. One example would be providing an array when we expected a string.

429 Too Many Requests

To keep the amount of spam on SoundCloud as low as possible, our API limits the rate at which you can perform certain actions. Read the Rate Limits page to find out more.

500 Internal Server Error

Uh-oh. Something went wrong on our side. We're sorry. We keep track of these, and we'll try to fix it!

503 Service Unavailable

This means that we're having some trouble, and our servers are too busy to handle your request. You'll want to check for these and give your user a chance to retry the request. We keep track of these and try to make sure they don't happen.

504 Gateway Timeout

This means the request is taking too long. However, it doesn't always mean that we didn't receive your request. We could still be chugging away on the changes you made, and this means that you may want to check before retrying.





broken image