Nominate a Submission
API Endpoint: nominate_submission
Nominates a submission to a Group.
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 |
---|---|---|
|
Group ID or group URL name of the group the public submission is being nominated format |
Required |
|
Submission ID or submission URL name of the group the public submission is being nominated from |
Required |
|
The reason the public submission is being nominated to the group |
Required |
Example 1: Nominate a Public Submission to a Group
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"
}
data = {
"group_id": 'group-url-name or group-id',
"submission_id": 'submission-url-name or submission-id',
"reason": "Reason for Submission Nomination"
}
url = 'https://edx.netl.doe.gov/api/3/action/nominate_submission'
r = requests.post(
url, # URL to API endpoint
headers=headers, # Headers dictionary
data=data, # Dictionary of data params
)
print (r.json())
print("End results")
{'help': '/api/3/action/help_show?name=nominate_submission', 'success': True, 'result': {'submission_name': 'test-submission', 'group': 'test-group',
'user': 'test-user', 'reason': 'Test the Reason'}}
End results