douchengfei3985 2016-03-25 17:22
浏览 23
已采纳

使用PHP使用API​​删除soundcloud上的曲目

I'm trying to delete a track on soundcloud via their API. I'm using the Njasm php library for sound cloud (not an official one as I don't think they have an official one).

I can upload fine but I'm not 100% sure how to delete a track.

I have this:

$params = array("id"=>255008920);                

$response = $facade->delete("/tracks", $params);   

But this does not seem to delete the track.

What do I have to use (even if it's not based on the Njasm library) to delete a track?

  • 写回答

2条回答 默认 最新

  • doucaishi0077 2016-04-08 23:44
    关注

    I'm the creator of the njasm library. First of all thanks for using it.

    In regard to your question: You are calling the right method with the right parameters, but you need to call the

    request()
    

    method in the end, to invoke the API. Assumming you're authenticated.

    Example:

    $facade = new SoundcloudFacade($clientID, $clientSecret);
    $facade->userCredentials($username, $password);
    $params = ["id" => 12345];
    $response = $facade->delete('/tracks')->request();
    // or
    $facade->delete('/tracks');
    $facade->setParams($params);
    $response = $facade->request();
    

    Hope it helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备