DataConservancy / osf-packaging

DEPRECATED - Do not clone or fork! See https://github.com/DataConservancy/dcs-packaging-osf/tree/master/osf-packager
1 stars 3 forks source link

common api for registrations and projects #7

Open emetsger opened 8 years ago

emetsger commented 8 years ago

Originally from @msuhovec:

This is definitely in the "wish" category.

In our current CurateND use of the command line package download, the user provides the project or registration id , e.g. 7xtyz, and off we go. The problem we have is that we've no idea if the project identifier refers to a registration or an active project, and the two have different API endpoints- https://api.osf.io/v2/registrations vs https://api.osf.io/v2/nodes. Right now, we're only trying the registration route. We could try a head request on both before proceeding, but besides being a clunky solution, it probably won't work if we allow private registrations / projects.

If there were an easy way to distinguish between the two, or a common API endpoint, life would be grand.