获取SoundCloud API中的客户端密钥?

huangapple go评论66阅读模式
英文:

How do i get the client secret in soundcloud api?

问题

我无法解决如何从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.

答案1

得分: 0

对于 Client Secret

首先,前往 Soundcloud 网站。登录或创建新帐户。注册一个应用程序。创建完应用程序后,您将看到客户端 ID 和客户端密钥。 (实际上,几乎所有类似的 API 都使用这种方法)

另一方面,如果您想获取一个 令牌,只需传递您在注册时获取的 client_idclient_secret 进行身份验证并获取令牌。

官方文档

英文:

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

huangapple
  • 本文由 发表于 2023年5月7日 07:29:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76191614.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定