How can I mute slack channels from the web API?
<p>I tried to mute slack channels with a call to the Slack API like this.</p>

<pre><code>&lt;?php
    $url = "https://slack.com/api/users.prefs.set";

    $POST_DATA = array(
        'token' =&gt; SLACK_TOKEN,
        'muted_channels' =&gt; TARGET_CHANNEL_ID,
    );

    $curl=curl_init($url);

    curl_setopt($curl,CURLOPT_POST, TRUE);
    curl_setopt($curl,CURLOPT_POSTFIELDS, http_build_query($POST_DATA));
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl,CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($curl,CURLOPT_FOLLOWLOCATION, TRUE);

    $output= curl_exec($curl);

    print_r($output);
</code></pre>

<p>But, it does not work.</p>