public
Last active

Share a single note

  • Download Gist
main.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None):
"""
Share a single note and return the public URL for the note
"""
if not shardId:
shardId = getUserShardId(authToken, userStore)
if not shardId:
raise SystemExit
 
try:
shareKey = noteStore.shareNote(authToken, noteGuid)
except (EDAMNotFoundException, EDAMSystemException, EDAMUserException), e:
print "Error sharing note:"
print type(e), e
return None
 
return "%s/shard/%s/sh/%s/%s" % \
(EN_URL, shardId, noteGuid, shareKey)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.