-
Notifications
You must be signed in to change notification settings - Fork 61
Push API
erinspace edited this page Dec 26, 2014
·
10 revisions
Right now, we have (very!) experimental Push API access for the SHARE Notification service.
The Push API accepts documents in the same metadata schema as our notification outputs.
For an example of this in action using python, see:
https://github.com/erinspace/SHARE_push_demo
- Register an API key on the share-dev site
- Create an account and sign in
- In the upper right hand corner, click the gear labeled "settings"
- On the left hand menu, click "Configure API Keys"
- Give your new key a name, and create a new API key by clicking "Create New Key"
- Prepare your content. Your content should be in json format, with 2 fields.
{
'source': 'your source name',
'events': [ { Your Events Here } ]
}
- source is the name that you'd like to appear as the source on the notification service.
- events is a list of individual events that you'd like to send to the notification service.
- Each event should be in the same format as the current metadata output
- POST your content to the SHARE push API -
http://share-dev.osf.io/api/dev/share/
along with your OSF API key as authorization.- Note: for the time being, the server verification is not 100% set up, so when making the API request you'll have to disable verification.
- If you're using the requests module in python like in this example pusher, you'll have to set verify=False for the push request
- This will be fixed soon!
- If your content was accepted, you'll receive a
201 Response
from the server!- Right now, malformed events are rejected, and send a
400 response
. - The reason for rejection along with specific instructions on how to fix the submission are included along in the text of the server response.
- An example of how to see this helpful text with python is included in the example pusher](https://github.com/erinspace/SHARE_push_demo)
- Right now, malformed events are rejected, and send a
- Check out the share notification stream to see your pushed content
Running Harvesters with ScrAPI
Consuming Notifications - Feed Options
Issues & Using the Issue Tracker
SHARE is a project of the ARL, AAU, and APLU. Development of the SHARE Notification Service is being carried out in partnership with the Center for Open Science and is supported by generous funding from The Institute of Museum and Library Services (IMLS) and the Alfred P. Sloan Foundation.