'POST /api/categories
Return a dictionary of information about the created category.
The following parameters are included in the payload:
:param name (required): the name of the category
:param description (optional): the description of the category (if not provided, the name will be used)
Example: POST /api/categories/?key=XXXYYYXXXYYY
Content-Disposition: form-data; name="name" Category_Name
Content-Disposition: form-data; name="description" Category_Description'

@expose_api
@require_admin
def create(self, trans, payload, **kwd):

    category_dict = dict(message='', status='ok')
    name = payload.get('name', '')
    if name:
        description = payload.get('description', '')
        if (not description):
            description = name
        if suc.get_category_by_name(self.app, name):
            raise exceptions.Conflict('A    category    with    that    name    already    exists.')
        else:
            category = self.app.model.Category(name=name, description=description)
            trans.sa_session.add(category)
            trans.sa_session.flush()
            category_dict = category.to_dict(view='element', value_mapper=self.__get_value_mapper(trans))
            category_dict['message'] = ("Category    '%s'    has    been    created" % str(category.name))
            category_dict['url'] = web.url_for(controller='categories', action='show', id=trans.security.encode_id(category.id))
    else:
        raise exceptions.RequestParameterMissingException('Missing    required    parameter    "name".')
    return category_dict
