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.

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

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"

  • Input
  • Successful Public Submission
  • Failed Public Submission
  • Successful Workspace Submission
  • Error Submission in Review Queue
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())
{'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.'}
{'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}
{'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'}
{'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}