claudybee
claudybee

Reputation: 29

Soundcloud + PHP: Authenticating without the Soundcloud screen and uploading tracks

I am building a simple site using the Soundcloud API that needs to do the following:

-- upload tracks to a single account without requesting user authentication (ie., Authenticating without the Soundcloud Screen)

-- display those tracks in a grid or list on a website, and on a map (I will be using the geo-tagging capability)

I am using PHP, which for most of this should be great. However - I am stuck on the authentication and upload piece, and am hungry for help or examples that might allow me to do this with PHP, or if I need to use Ruby or Python, how can I avoid rewriting the pieces I've done in PHP so far, and integrate the two things? If anyone can point me to how this can be done with PHP, that would be perfect!

Thank you.

Upvotes: 0

Views: 491

Answers (1)

nickf
nickf

Reputation: 546035

Upload tracks to a single account without requesting user authentication (ie., Authenticating without the Soundcloud Screen)

Users will have to go to the popup screen. This is quite common for logging into third party services (think about how it works for Facebook Connect, or even for logging into Stack Overflow). It's also a security feature for users: they're effectively giving you the keys to their account, so it should be very clear what's happening.

http://developers.soundcloud.com/docs/api/guide#authentication

Display those tracks in a grid or list on a website, and on a map (I will be using the geo-tagging capability)

This depends on what you mean by "those tracks": if you want all their tracks, then you can just use the API to fetch all tracks by a given user (/users/:user_id/tracks). If it's just the tracks they've uploaded using your app, you have a couple of different options depending on what you want to do.

You can get all public tracks uploaded with your application (/apps/:app_id/tracks), but that would include tracks by everyone, and only public tracks. You could get all tracks by the current user (which would include private tracks) and then filter them inside your application by finding ones created with your app. This information is stored in the "created_with" property. eg:

     "created_with": {
        "id": 124,
        "name": "SoundCloud iPhone",
        "uri": "http://api.soundcloud.com/apps/124",
        "permalink_url": "http://soundcloud.com/apps/iphone"
      }

Displaying them in a grid or a map, I think probably is a different question though...

Upvotes: 1

Related Questions