Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created September 17, 2015 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
Copy link
Author

rdhyee commented Sep 17, 2015

Note: the settings module contains DMPTOOL_TOKEN, which is my DMPTool token.

@marisastrong
Copy link

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?

@marisastrong
Copy link

I'm thinking Stephanie gave you institutional admin rights, which is why it's working now.

@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":"dmp2user123@gmail.com"},"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