MtApi.setPostCategories (postid, username, password, categories)
mt.setPostCategories sets the categories for a post Antville currently just supports one category per story

  • Parameter postid:
    String
  • Parameter username:
    String
  • Parameter password:
    String
  • Parameter categories:
    Array of Objects with the following properties .categoryId String .categoryName String, equals .categoryId .isPrimary Boolean, will be ignored
  • Returns
    Boolean true if successful
Sourcecode in MtApi/moveabletypeAPI.js:
1:   function setPostCategories(postid, username, password, categories) {
2:      var usr = root.blogger.getUser(username, password);
3:      var entry = root.storiesByID.get(postid.toString());
4:      if (!entry)
5:         throw("Couldn't find the story with id " + postid);
6:      var level = entry.site.members.getMembershipLevel(usr);
7:      try {
8:         entry.checkEdit(usr, level);
9:      } catch (deny) {
10:        throw("You are not allowed to edit the story with id "+postid);
11:     }
12:     if (categories.length>0)
13:        entry.topic = categories[0].categoryId;
14:     else
15:        entry.topic = null;
16:     return true;
17:  }