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条)

报告相同问题?

悬赏问题

  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计