'export_archive( self, trans, id, payload )
* PUT /api/histories/{id}/exports:
start job (if needed) to create history export for corresponding
history.
:type   id:     str
:param  id:     the encoded id of the history to export
:rtype:     dict
:returns:   object containing url to fetch export from.'

@expose_api
def archive_export(self, trans, id, **kwds):

    history = self.history_manager.get_accessible(self.decode_id(id), trans.user, current_history=trans.history)
    jeha = history.latest_export
    up_to_date = (jeha and jeha.up_to_date)
    if ('force' in kwds):
        up_to_date = False
    if (not up_to_date):
        gzip = kwds.get('gzip', True)
        include_hidden = kwds.get('include_hidden', False)
        include_deleted = kwds.get('include_deleted', False)
        self.queue_history_export(trans, history, gzip=gzip, include_hidden=include_hidden, include_deleted=include_deleted)
    if (up_to_date and jeha.ready):
        jeha_id = trans.security.encode_id(jeha.id)
        return dict(download_url=url_for('history_archive_download', id=id, jeha_id=jeha_id))
    else:
        trans.response.status = '202    Accepted'
        return ''
