-
-
Save rdhyee/f6339bead9112619a20c to your computer and use it in GitHub Desktop.
Hi Raymond, I tried this again today when describing the problem to Scott Fisher our developer and I was no longer able recreate the issue. Are you still having this problem?
I'm thinking Stephanie gave you institutional admin rights, which is why it's working now.
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 "}}
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.
Note: the settings module contains
DMPTOOL_TOKEN
, which is my DMPTool token.