'POST /api/visualizations
creates a new visualization using the given payload
POST /api/visualizations?import_id={encoded_visualization_id}
imports a copy of an existing visualization into the user\'s workspace'

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

    rval = None
    if ('import_id' in payload):
        import_id = payload('import_id')
        visualization = self.import_visualization(trans, import_id, user=trans.user)
    else:
        payload = self._validate_and_parse_payload(payload)
        if ('type' not in payload):
            raise exceptions.RequestParameterMissingException("key/value    'type'    is    required")
        vis_type = payload.pop('type', False)
        payload['save'] = True
        try:
            visualization = self.create_visualization(trans, vis_type, **payload)
        except ValueError as val_err:
            raise exceptions.RequestParameterMissingException(str(val_err))
    rval = {'id': trans.security.encode_id(visualization.id)}
    return rval
