The code below can be used to add a category by key to a contentlet when calling the checkin method.
User user = APILocator.getUserAPI().getSystemUser(); CategoryAPIImpl categoryAPIImpl = new CategoryAPIImpl(); Category category = categoryAPIImpl.findByKey("mykey", user, false); List<Category> categoryList = new ArrayList<Category>(); categoryList.add(category); content = conAPI.checkin(content, user, false, categoryList);