MtApi.getPostCategories (postid, username, password)
mt.getPostCategories returns a list of all categories to which the post is assigned to Antville currently just supports one category per story

  • Parameter postid:
    String
  • Parameter username:
    String
  • Parameter password:
    String
  • Returns
    Array of Objects representing Categories with the following properties .categoryId String .categoryName String, equals .categoryId .isPrimary Boolean, always true in Antville
Sourcecode in MtApi/moveabletypeAPI.js:
1:   function getPostCategories(postid, username, password) {
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.checkView(usr, level);
9:      } catch (deny) {
10:        throw("You are not allowed to view the story with id " + postid);
11:     }
12:     var topics = new Array();
13:     if (entry.topic) {
14:       var param = new Object();
15:       param.categoryId = entry.topic;
16:       param.categoryName = entry.topic;
17:       param.isPrimary = true;
18:       topics[0] = param;
19:     }
20:     return topics;
21:  }