Create a Private Submission
API Endpoint: submission_create
Creates a new private submission.
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 Name |
Description |
Required Fields |
---|---|---|
|
|
Required |
|
Title of the Submission (Human readable - spaces and capitalization are allowed) |
Required |
|
URL structured name that must be lowercase and alphanumeric - underscores and dashes are allowed |
Required |
|
Description of the Submission |
Required |
|
Citation for the Submission |
Required |
|
Keywords describing submission. It must be a comma separated string if multiple keywords are listed |
Required |
|
Determines if submission is a product of NETL funded research |
Required |
|
NETL Point of Contact email address |
Situational Required |
|
First and Last name of NETL Point of Contact |
Situational Required |
|
NETL Program or Project the Submission is associated with |
Situational Required |
|
NETL project/contract number associated with the NETL funded project |
Situational Required |
|
Determines if submission is an Artificial Intelligence Machine Learning (AIML) product |
Required |
|
Submission type associated with the AIML product. |
Situational Required |
|
Determines if submission is a Geospatial product |
Required |
|
Determines if Geospatial product is FGDC Compliant |
Situational Required |
|
Date the Submission will be Published. Format yyyy-mm-dd |
Optional |
|
Date the submission will be released to the public after approval. Format yyyy-mm-dd |
Optional |
|
First and Last name of the Maintainer |
Optional |
|
Email address of the Maintainer |
Optional |
|
The name or ID of workspace that you wish to add a Submission to if it is intended for Private use |
Optional |
Example 4 : Create a New Private Submission with Additional NETL and Geospatial Fields
Attention
Add the
"User-Agent":
parameter within theheaders
of the API requestSet
"User-Agent":
to the value"EDX-USER"
import requests
headers = {
"EDX-API-Key": 'YOUR_API_KEY_HERE',
"User-Agent": 'EDX-USER',
'Content-Type': 'application/json',
'Accept':'application/json'
}
data = {
'type': 'dataset', # type must match one of four EDX approved submission types: dataset, tool, publication, presentation. Required
'title': 'Example Submission', #Required
'name': 'example-submission', #Must have at least 2 alphanumeric characters. Must be all lowercase and supports underscores and dashes.Required
'description': 'This is an example.', #Required
'citation': 'John Smith, Example Submission, 5/24/2024, https://edx.netl.doe.gov/dataset/example-submission', #Required
'keywords': 'example, example2', #Required. Can be a comma separated string
'netl_product': 'yes', # If not y, yes, or True, 'True' == no. Required
'poc_email': 'scout.finch@netl.doe.gov', #required if netl_product is yes. Ignored if netl_product is no or missing. must have @netl.doe.gov or @contr.netl.doe.gov in email
'point_of_contact': 'Scout Finch', #required if netl_product is yes. Ignored if netl_product is no or missing.
'program_or_project': 'Geothermal 4D', #required if netl_product is yes. Ignored if netl_product is no or missing.
'project_number': '1234567', #required if netl_product is yes. Ignored if netl_product is no or missing.
'aiml_product': 'yes', #If not y, yes, or True, 'True' == no . Required
'aiml_submission_types': [ "compiledModel", "gitLinkModel", "aiResource" ], #required if aiml_product is yes. Must be an array. Items in list must match one of 5 types.Ignored if aiml_product is no or missing.
'geospatial_product': 'yes', # If not y, yes, or True, 'True' == no . Required
'fgdc_compliant': 'no' , # If not y, yes, or True, 'True' == no . Required if geospatial_product is yes. Ignored if geospatial_product is missing.
'publication_date': '2024-05-24', # format yyyy-mm-dd
'restriction_date': '2025-01-31', # format yyyy-mm-dd
'maintainer': 'Jack Horner',
'maintainer_email': 'jack.horner@netl.doe.gov', # Must be valid email format.
#AUTHOR_TYPES: author, contact, contributor
'authors': [
{
'username': 'EDX-AUTHOR-USERNAME',
'type': 'AUTHOR-TYPE'
},
{
'fullname': 'NON-EDX-AUTHOR-FULL-NAME',
'type': 'AUTHOR-TYPE'
},
],
}
url = 'https://edx.netl.doe.gov/api/3/action/submission_create'
r = requests.post(
url, # URL to API endpoint
headers=headers, # Headers dictionary
json=data, # Dictionary of data params
)
r_json = r.json()
print (r.json())
{'help': '/api/3/action/help_show?name=submission_create', 'success': True, 'result': {'id': 'c1abbb28-cf51-48bf-98e5-a7f07b5973e3',
'authors': [{'id': 'd3083789-6e6c-4e0d-b55d-cf47d6751be5', 'name': 'edx-user', 'fullname': 'EDX USER', 'type': 'author', 'position': 0}],
'creator_user_id': 'd3083789-6e6c-4e0d-b55d-cf47d6751be5', 'description': 'This is an example.', 'keywords': 'example, example2', 'name':
'test-multi-netl-author', 'maintainer': 'Jack Horner', 'maintainer_email': 'jack.horner@netl.doe.gov', 'metadata_created': '2025-01-28 15:46',
'metadata_modified': '2025-01-28 15:46', 'num_resources': 0, 'workspace_id': None, 'package_reviewed': False, 'private': False, 'state': 'draft',
'title': 'Example Submission', 'type': 'dataset', 'non_edx_authors': [{'fullname': 'Scout Finch', 'type': 'contact', 'position': 1}],
'publication_date': '2024-05-24', 'restriction_date': '2025-01-31', 'netl_product': 'yes', 'poc_email': [{'fullname': 'Scout Finch', 'type':
'contact', 'position': 1}], 'point_of_contact': 'Scout Finch', 'program_or_project': 'Geothermal 4D', 'project_number': '1234567', 'aiml_product':
'yes', 'aiml_submission_types': ['compiledModel', 'gitLinkModel', 'aiResource'], 'geospatial': 'yes', 'fgdc_compliant': None}}
import requests
headers = {
"EDX-API-Key": 'YOUR_API_KEY_HERE',
"User-Agent": 'EDX-USER',
'Content-Type': 'application/json',
'Accept':'application/json'
}
data = {
'type': 'dataset', # type must match one of four EDX approved submission types: dataset, tool, publication, presentation. Required
'title': 'Example Submission', #Required
'name': 'example-submission', #Must have at least 2 alphanumeric characters. Must be all lowercase and supports underscores and dashes.Required
'description': 'This is an example.', #Required
'citation': 'John Smith, Example Submission, 5/24/2024, https://edx.netl.doe.gov/dataset/example-submission', #Required
'keywords': 'example, example2', #Required. Can be a comma separated string
'netl_product': 'yes', # If not y, yes, or True, 'True' == no. Required
'poc_email': 'scout.finch@example.com', #required if netl_product is yes. Ignored if netl_product is no or missing. must have @netl.doe.gov or @contr.netl.doe.gov in email
'point_of_contact': 'Scout Finch', #required if netl_product is yes. Ignored if netl_product is no or missing.
'program_or_project': 'Geothermal 4D', #required if netl_product is yes. Ignored if netl_product is no or missing.
'project_number': '1234567', #required if netl_product is yes. Ignored if netl_product is no or missing.
'aiml_product': 'yes', #If not y, yes, or True, 'True' == no . Required
'aiml_submission_types': [ "compiledModel", "gitLinkModel", "aiResource" ], #required if aiml_product is yes. Must be an array. Items in list must match one of 5 types.Ignored if aiml_product is no or missing.
'geospatial_product': 'yes', # If not y, yes, or True, 'True' == no . Required
'fgdc_compliant': 'no' , # If not y, yes, or True, 'True' == no . Required if geospatial_product is yes. Ignored if geospatial_product is missing.
'publication_date': '2024-05-24', # format yyyy-mm-dd
'restriction_date': '2025-01-31', # format yyyy-mm-dd
'maintainer': 'Jack Horner',
'maintainer_email': 'jack.horner@netl.doe.gov', # Must be valid email format.
#AUTHOR_TYPES: author, contact, contributor
'authors': [
{
'username': 'EDX-AUTHOR-USERNAME',
'type': 'AUTHOR-TYPE'
},
{
'fullname': 'NON-EDX-AUTHOR-FULL-NAME',
'type': 'AUTHOR-TYPE'
},
],
}
url = 'https://edx.netl.doe.gov/api/3/action/submission_create'
r = requests.post(
url, # URL to API endpoint
headers=headers, # Headers dictionary
json=data, # Dictionary of data params
)
r_json = r.json()
print (r.json())
{'help': '/api/3/action/help_show?name=submission_create', 'error': {'netl_product': ['poc_email: Your poc_email must have @netl.doe.gov or @contr.netl.doe.gov email address.'],
'__type': 'Validation Error'}, 'success': False}