'GET /api/requests/{encoded_request_id}
Displays details of a sequencing request.'

@web.expose_api
def show(self, trans, id, **kwd):

    try:
        request_id = trans.security.decode_id(id)
    except TypeError:
        trans.response.status = 400
        return ('Malformed    id    (    %s    )    specified,    unable    to    decode.' % str(id))
    try:
        request = trans.sa_session.query(trans.app.model.Request).get(request_id)
    except:
        request = None
    if ((not request) or (not (trans.user_is_admin() or (request.user.id == trans.user.id)))):
        trans.response.status = 400
        return ('Invalid    request    id    (    %s    )    specified.' % str(request_id))
    item = request.to_dict()
    item['url'] = url_for('requests', id=trans.security.encode_id(request.id))
    item['id'] = trans.security.encode_id(item['id'])
    item['user'] = request.user.email
    item['num_of_samples'] = len(request.samples)
    return item
