.. _finalize-submission: Finalize a Submission ====================== Finalizing a submission is the act of changing the submission status from a draft state to active. If a submission contains a workspace ID, it will move the submission to the appropriate workspace it is assigned to. If a submission does not contain a workspace ID, it will move the submission to the Public Review Queue for NETL POC / EDX Data Reviewer approval. .. admonition:: API Endpoint: submission_finalize Finalize a submission. .. warning:: Once a submission the the Review Queue, you cannot make additional adjustments via the API until it is approved or rejected. Rejected submissions return to the original contributor in a draft state. .. important:: An API Key is required for ALL private workspace activities The API Key name component can be added to your header using any of the following ways, "X-CKAN-API-Key", "EDX-API-Key", or "Authorization". Parameter Definitions ---------------------- .. list-table:: :header-rows: 1 * - Parameter Definition - Description - Required Fields * - ``id`` - Name or ID of submission - **Required** Example 1: Finalize a Submission -------------------------------------------- .. attention:: * Add the ``"User-Agent":`` parameter within the ``headers`` of the API request * Set ``"User-Agent":`` to the value ``"EDX-USER"`` .. tabs:: lang3 .. code-tab:: :caption: Input import requests headers = { "EDX-API-Key": 'YOUR-API-KEY-HERE', "User-Agent": 'EDX-USER' } data = { 'id': 'testing-api-5-16-3' # Name or id } url = 'https://edx.netl.doe.gov/api/3/action/submission_finalize' r = requests.post( url, # URL to API endpoint headers=headers, # Headers dictionary data=data, # Dictionary of data params ) r_json = r.json() print (r.json()) .. code-tab:: :caption: Successful Public Submission {'help': '/api/3/action/help_show?name=submission_finalize', 'success': True, 'result': 'Test on May 23 is now in the Review Queue waiting for approval.'} .. code-tab:: :caption: Failed Public Submission {'help': '/api/3/action/help_show?name=submission_finalize', 'error': {'message': 'You cannot finalize an public submission that has already been approved.', '__type': 'Validation Error'}, 'success': False} .. code-tab:: :caption: Successful Workspace Submission {'help': '/api/3/action/help_show?name=submission_finalize', 'success': True, 'result': 'Test on May 23 is now active in the workspace: b5e9b15e-6331-442f-85b7-7edafc2df0e9'} .. code-tab:: :caption: Error Submission in Review Queue {'help': '/api/3/action/help_show?name=submission_finalize', 'error': {'__type': 'Authorization Error', 'message': 'Access denied: "Test on May 23" is pending approval. A Submission Reviewer will review the submission before it becomes available to the public.'}, 'success': False}