How do i get the client secret in soundcloud api?

411 Views Asked by At

i cant work out how to get the client secret from the soundcloud api,

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

$client = new Services_Soundcloud(
'----------', 'client-secret');

$userid     = --------;

try {
  $response = json_decode($client->get('users/'.$userid.'/tracks'), true);
  var_dump($response);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
  exit($e->getMessage());
}
?>

I tryed looking online about it but not much people seems to have this problem.

i tryed looking in responce headers and network tab in inspect and loads more, i cant seem to find the client secret.

2

There are 2 best solutions below

1
Ken Lee On BEST ANSWER

For Client Secret:

First, go to Soundcloud website. Log in or create a new account. Register an app. After creation your app you will see Client ID and Client Secret. (Actually nearly all similar APIs are using this approach)

On the other hand, if you want to get a token, then just pass along the client_id and client_secret you have acquired at registration to authenticate and get a token.

official documentation

0
Kera Linn On

This is from my successful app registration experience within the past month.

The Google Form DOES still say that they are no longer accepting application requests, BUT I sent an email to their support team ([email protected]) telling them that I wanted to register a new app to use their API. I let them know:

The App Name The App Description (briefly) How I intended to use their API The account I wanted to register the app under.

I received an answer from SoundCloud Support within 48 hours advising the app had been created and the details were under https://soundcloud.com/you/apps.

Hope this helps, and if not you, hopefully it helps someone else in the future!