Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm playing with the write API, and I'd like to simply retag a question. This is the code I have so far:

$editURL = '' . $question->{"question_id"} . '/edit';
echo '' . $question->{"question_id"} . '/edit';
$editData = array('site' => 'stackoverflow', 'preview' => 'true', 'id' => $question->{"question_id"}, 'key' => "6Z09liTt4uTQU*a4DYOXVQ((", 'access_token' => $access_token, 'title' => $question->{"title"}, 'body' => $question->body_markdown, 'tags' => $taglist, 'comment' => 'rm [' . $tag . '] tag');
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded, Accept-Encoding: gzip;q=0, compress;q=0\r\n",
        'method'  => 'POST',
        'content' => http_build_query($editData),
        'ignore_errors' => true,
$context = stream_context_create($options);
print_r(gzdecode(file_get_contents($editURL, false, $context)));

When I turn preview to false, it works and retags the question. However, it also adds in some HTML entities (like encoding stuff, &quote and whatnot) to the title and body. Is there a way to not bother with passing the existing title and markdown and just editing the tags?

share|improve this question
did you ever solve this? – Tim May 27 '15 at 10:27

You must log in to answer this question.

Browse other questions tagged .