phpsoundcloud

How do i get the client secret in soundcloud api?


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.


Solution

  • 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