Skip to content

Commit 970bec8

Browse files
committed
Add script for publishing record to override DOI restriction in versions
1 parent ce15180 commit 970bec8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎publish_record.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import requests
2+
import os
3+
4+
publish_link = (
5+
"https://authors.library.caltech.edu/api/records/rjcyg-wqy42/draft/actions/publish"
6+
)
7+
8+
token = os.environ["RDMTOK"]
9+
10+
headers = {
11+
"Authorization": "Bearer %s" % token,
12+
"Content-type": "application/json",
13+
}
14+
15+
result = requests.post(publish_link, headers=headers)
16+
if result.status_code != 202:
17+
raise Exception(result.text)

0 commit comments

Comments
 (0)