Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created September 17, 2015 20:57
Show Gist options
  • Save rdhyee/f6339bead9112619a20c to your computer and use it in GitHub Desktop.
Save rdhyee/f6339bead9112619a20c to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marisastrong
Copy link

Hi Raymond, we tried this again with another user who did not have inst admin privileges and it was working.

user (dmp2user123) who just had one plan that was private. I created an API key and was able to show the plan.

curl -H "Authorization: Token token=d93a2be06b6be6ddbb7cb432881200df" https://dmp2-dev.cdlib.org/api/v1/plans/1562

{"plan":{"id":1562,"name":"Copy of The Nine Lives of Kitty Cats","solicitation_identifier":"666","visibility":"private","created":"09/28/2015","modified":"09/28/2015","owner":{"full_name":"dmp2user123 dmp2user123","email":"[email protected]"},"template":{"name":"Cat Questions","active":true,"start_date":"03/05/2014","end_date":"03/18/2015","review_type":"no_review"},"state":"new","institution":"NonPartner Institution "}}

@rdhyee
Copy link
Author

rdhyee commented Sep 29, 2015

My mistake. The line in cell 7 above

headers = {'Authorization': DMPTOOL_TOKEN}

should be

headers = {'Authorization': 'Token token={}'.format(DMPTOOL_TOKEN)}

https://gist.github.com/rdhyee/a64c2c5380edc92efe07 shows this fix in operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment