-
Notifications
You must be signed in to change notification settings - Fork 1
Api Sources Post
Carlos Badenes edited this page Mar 31, 2016
·
1 revision
A new source will be created. The only information required from the user is the url of the source.
These are some request examples:
- A OAI-PMH repository:
{
"url": "oaipmh://oa.upm.es/perl/oai2"
}
- A RSS feed:
{
"url": "rss://rss.slashdot.org/Slashdot/slashdot"
}
- A ZIP file from DropBox:
{
"url": "https://dl.dropboxusercontent.com/u/132555/library/papers.zip"
}
Once the request is accepted by the API module, a HTTP 202 response will be answered indicating that the instruction was accepted and the resource was marked for the creation (more details here).
An internal event-message is sent to routing-key source.new to publish this action and both the Harvester and the Hoarder module, which are listening for that type of events, will start to make the related operations.
POST http://zavijava.dia.fi.upm.es:8888/api/sources/
HEADER:
Authorization: 70b88ce0-9cb8-23e5-62dd-0002a4d3c52c
Content-Type: application/json
{
"url": "oaipmh://oa.upm.es/perl/oai2"
}
- curl:
curl -i -X POST -H "Authorization: 70b88ce0-9cb8-23e5-62dd-0002a4d3c52c" -d "{ 'url': 'oaipmh://oa.upm.es/perl/oai2'}" http://zavijava.dia.fi.upm.es:8888/api/sources
202 Accepted
{
"uri": "sources/11111111-2222-3333-4444-555555555555"
}
work supported by the European Community's Seventh Framework Programme (FP7-ICT-2013-8.1) under grant agreement no: 611383. For further information please see http://DrInventor.eu