'Allow anonymous access to a dashboard.
:param dashboard_id: The numeric ID of the dashboard to share.
:>json string public_url: The URL for anonymous access to the dashboard.
:>json api_key: The API key to use when accessing it.'

def post(self, dashboard_id):

    dashboard = models.Dashboard.get_by_id_and_org(dashboard_id, self.current_org)
    require_admin_or_owner(dashboard.user_id)
    api_key = models.ApiKey.create_for_object(dashboard, self.current_user)
    models.db.session.flush()
    models.db.session.commit()
    public_url = url_for('redash.public_dashboard', token=api_key.api_key, org_slug=self.current_org.slug, _external=True)
    self.record_event({'action': 'activate_api_key', 'object_id': dashboard.id, 'object_type': 'dashboard'})
    return {'public_url': public_url, 'api_key': api_key.api_key}
