-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation
is a web API to the Phaidra repository. It can be used for CRUD operations on digital objects or other resources (like groups). It also implements some workflow steps like creating an index database or an update request for the image server.
The API supports CORS, so it could be called from a client's javascript without the need for a proxy.
Most of the methods take and return JSON-formatted data. The response is usually a JSON document with the following structure:
{
"alerts": [
{
"msg": "it works!",
"type": "success"
}
],
"status": 200,
"method_specific_data": "some data structure",
}
where the 'type' of message are the types of Bootstrap alerts (success, info, warning and danger).
Continue reading:
Because the installation requires integration with the authentication resources at the particular institution, it is usually provided by the Phaidra team.
If the API isn't running at your Phaidra instance, please contact us via our support email [email protected].
The installation procedure is described here. As stated, installing the API would probably not be enough to have a fully functional API to the repository.
Methods that need authentication can be accessed:
- using Basic HTTP Authentication, eg
https://username:password@apiurl/method
- using a token
If you want to use the token, you have to call the login (signin) method using Basic Authentication. The response is a JSON document containing the token, eg
{
"alerts": [],
"XSRF-TOKEN": "4f7d406dab571e601eb52d7383fe5b6602d9d697"
}
You'll get a cookie called XSRF-TOKEN set with the token value. You then have to send this token back in an X-XSRF-TOKEN header for each authenticated call. See 'Cross-site Request Forgery (XSRF) Protection' at AngularJS page.
Authentication only:
Optional authentication:
- Check authorization (get) authz/check/:pid/:op
You can create an object in more than one way, see Cookbook. Depending on the way you choose you might need to call one or more of the methods.
No authentication:
- Get metadata (get) object/:pid/metadata
- Get uwmetadata (get) object/:pid/uwmetadata
- Get mods (get) object/:pid/mods
- Get geo (get) object/:pid/geo
- Get annotations (get) object/:pid/annotations
- Get techinfo (get) object/:pid/techinfo
- Get dc (get) object/:pid/dc
- Get oai_dc (get) object/:pid/oai_dc
- Get index (get) object/:pid/index
- Get identifiers (get) object/:pid/id
- Get related objects (get) object/:pid/related
- Get state (get) object/:pid/state
Optional authentication:
- Get object's data (get) object/:pid/octets
- Get object's fulltext data (get) object/:pid/fulltext
- Get object's data by disseminator (get) object/:pid/diss/:bdef/:method
Authentication only:
- Create simple object (post) picture/create, document/create, video/create, audio/create
- Create empty object (post) object/create
- Modify object properties (post) object/:pid/modify
- Delete object (post) object/:pid/delete
- Save metadata (post) object/:pid/metadata
- Add data (post) object/:pid/data
- Add or modify datastream (post) object/:pid/datastream/:dsid
- Get rights (get) object/:pid/rights
- Save rights (post) object/:pid/rights
- Save geo (post) object/:pid/geo
- Save annotations (post) object/:pid/annotations
- Save uwmetadata (post) object/:pid/uwmetadata
- Save mods (post) object/:pid/mods
- Add identifier (post) object/:pid/id/add
- Remove identifier (post) object/:pid/id/remove
- Add relationship (post) object/:pid/relationship/add
- Remove relationship (post) object/:pid/relationship/remove
Admin authentication only:
- Update index (post) object/:pid/index
- Update DC (post) object/:pid/dc
No authentication:
- Get the uwmetadata tree (get) uwmetadata/tree
- Uwmetadata json to xml (post) uwmetadata/json2xml
- Uwmetadata xml to json (post) uwmetadata/xml2json
- Validate uwmetadata (post) uwmetadata/validate
- Uwmetadata json to xml and validate (post) uwmetadata/json2xml_validate.
- Compress uwmetadata (post) uwmetadata/compress
- Decompress uwmetadata (post) uwmetadata/decompress
No authentication:
- Get the mods tree (get) mods/tree
- Mods json to xml (post) mods/json2xml
- Mods xml to json (post) mods/xml2json
- Validate uwmetadata (post) mods/validate
- Mods json to xml and validate (post) mods/json2xml_validate
No compress/decompress methods are available. Mods is always saved as compressed.
No authentication:
- Rights json to xml (post) rights/json2xml
- Rights xml to json (post) rights/xml2json
- Validate rights (post) rights/validate
- Rights json to xml and validate (post) rights/json2xml_validate
No authentication:
- Geo json to xml (post) geo/json2xml
- Geo xml to json (post) geo/xml2json
- Validate geo (post) geo/validate
- Geo json to xml and validate (post) geo/json2xml_validate
No authentication:
- Annotations json to xml (post) annotations/json2xml
- Annotations xml to json (post) annotations/xml2json
- Validate annotations (post) annotations/validate
- Annotations json to xml and validate (post) annotations/json2xml_validate
No authentication:
- Get languages (get) languages
No authentication:
- Get licenses (get) licenses
No authentication:
- Get organisational units (get) directory/get_org_units
- Get parent of a unit (get) directory/get_parent_org_unit_id
- Get study (get) directory/get_study
- Get study name (get) directory/get_study_name
- Get user data (get) directory/user/:username/data
- Get name of a user (get) directory/user/:username/name
- Get email of a user (get) directory/user/:username/email
Authentication only:
- Search users (get) directory/user/search
If your instance is using Solr, query your Solr endpoint instead.
No Authentication:
- Search for triples (get) search/triples
No authentication:
- Get term's labels (get) terms/label
- Get term's children (get) terms/children
- Get term's parent (get) terms/parent
- Get all term's parents recursively (get) terms/taxonpath
- Search for a term (get) terms/search
No authentication:
- Get collection members (get) collection/:pid/members
Authentication only:
- Create a collection object (post) collection/create
- Add collection members (post) collection/:pid/members/add
- Remove collection members (post) collection/:pid/members/remove
- Order collection members (post) collection/:pid/members/order
- Change collection member position (post) collection/:pid/members/:itempid/order/:position
Admin authentication only:
- Update index for provided pids (post) index
Admin authentication only:
- Update DC for provided pids (post) dc
No authentication:
- Get object's usage statistics (get) stats/:pid
- Get object's downloads count (get) stats/:pid/downloads
- Get object's detail page views count (get) stats/:pid/detail_page
No authentication:
- Get all pids (get) utils/get_all_pids
Admin authentication:
- Create imageserver job for one pid (post) imageserver/:pid/process
- Create imageserver job for provided pids (post) imageserver/process
- Get imageserver job status (get) imageserver/:pid/status
Optional authentication:
- Imageserver api (get) imageserver
Authentication only:
- Get user's groups (get) groups
- Get group (get) group/:gid
- Add group (post) group/add
- Remove group (post) group/:gid/remove
- Add group members (post) group/:gid/members/add
- Remove group members (post) group/:gid/members/remove
GET signin
Example
curl -X GET --user username:password "https://services.phaidra-sandbox.univie.ac.at/api/signin"
Response
{
"alerts":[],
"XSRF-TOKEN":"944afd4c0b303b482e3a9cb5e31a061e76f350f3"
}
GET keepalive
This method can be used to extend the 'expires' date for the session (the session is identified by the token). Typically, if you'd implement a frontend, you'd want the API session to last as long as a session on your frontend. The API automatically extends the session on any operation, but your frontend does not necessarily contact the API when the user interacts with it. The keepalive can be used to keep the API session alive upon any user interaction so that the API session is kept alive if the user interacts with the frontend.
Example
curl -X GET -H "X-XSRF-TOKEN: 944afd4c0b303b482e3a9cb5e31a061e76f350f3" "https://services.phaidra-sandbox.univie.ac.at/api/keepalive"
The response contains the new 'expires' date
{
"sid":"944afd4c0b303b482e3a9cb5e31a061e76f350f3",
"expires":1471873213
}
GET signout
Example
curl -X GET -H "X-XSRF-TOKEN: 944afd4c0b303b482e3a9cb5e31a061e76f350f3" "https://services.phaidra-sandbox.univie.ac.at/api/signout"
Response (if there was no session, 'No session found' message would be returned)
{
"sid": "944afd4c0b303b482e3a9cb5e31a061e76f350f3",
"alerts":[{"msg":"You have been signed out","type":"success"}]
}
GET authz/check/:pid/:op
This method can be used to check if an object is readable/writable. The ':op' parameter can be 'ro' or 'rw'. Authentication is optional, as you might want to know if an object is readable for an unauthenticated user. An object is never writable for an unauthenticated user, so checking 'rw' only makes sense with authentication. Typically, an object is only writable for its owner.
Example 1
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/authz/check/o:16055/ro"
Response 1
{
"alerts":[],
"status":200
}
Example 2
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/authz/check/o:16055/rw"
Response 2
{
"alerts":[{"msg":401,"type":"danger"}],
"status":403
}
GET object/:pid/metadata
Use this method to get the object's primary metadata datastreams. These are UWMETADATA or MODS or JSON-LD, RIGHTS and GEO.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:16055/metadata"
Response
{
"metadata": {
"uwmetadata":["..."],
"rights":["..."],
"geo":["..."],
"json-ld":["..."]
}
}
GET object/:pid/uwmetadata
Use this method to get the object's uwmetadata datastream. See datastream examples.
Param name | Possible values |
---|---|
format | xml |
mode | full, basic, resolved |
If the format param is set to 'xml', the datastream would be returned as it is saved in Fedora.
If the mode is 'full', the whole tree with filled-in values will be returned.
If the mode is 'basic' (default), only the filled-in nodes are returned.
If the mode is 'resolved', the same JSON as in 'basic' mode will be returned, but all IDs will be resolved to labels.
If the format param and mode param are both used, only the format param will be considered.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:16055/uwmetadata"
Response
{
"metadata": {
"uwmetadata":["..."]
}
}
GET object/:pid/mods
Use this method to get the object's mods datastream. See datastream examples.
Param name | Possible values |
---|---|
format | xml |
mode | full, basic |
If the format param is set to 'xml', the datastream would be returned as it is saved in Fedora.
If the mode is 'full', the whole tree with filled-in values will be returned.
If the mode is 'basic' (default), only the filled-in nodes are returned.
If the format param and mode param are both used, only the format param will be considered.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/mods"
Response
{
"metadata": {
"mods":["..."]
}
}
GET object/:pid/geo
Use this method to get the object's geo datastream. The datastream is saved as OGC-KML XML but currently only returned in an json representation. See datastream examples.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/geo"
Response
{
"metadata": {
"geo":["..."]
}
}
GET object/:pid/annotations
Use this method to get the object's annotations datastream. The datastream is saved as XML but currently only returned in an json representation. See datastream examples.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:123/annotations"
Response
{
"metadata": {
"alerts": [],
"status": 200,
"annotations": {
"1": {
"w": "0.2",
"y": "0.6",
"h": "0.18",
"text": "prussian blue",
"category": "pigments",
"x": "0.7"
},
"2": {
"w": "0.15",
"y": "0.8",
"h": "0.1",
"text": "azurite",
"category": "pigments",
"x": "0.1"
},
"3": {
"w": "0.1",
"y": "0.4",
"h": "0.1",
"text": "Mary",
"category": "people",
"x": "0.7"
}
}
}
}
GET object/:pid/techinfo
Use this method to get the object's techinfo datastream. This basically contains EXIF data. It is only available in XML format so you have to call it with the format=xml
parameter. See datastream examples.
Param name | Possible values |
---|---|
format | xml |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:147438/techinfo" -d "format=xml"
Response See datastream examples
GET object/:pid/dc
Use this method to get the object's Dublin Core datastream. See datastream examples.
Param name | Possible values |
---|---|
format | xml, index |
If the format param is set to 'xml', the datastream would be returned as it is saved in Fedora.
When the format is 'index', the JSON data is formatted in a more hash-like structure. See datastream examples.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/dc"
Response
{
"metadata": {
"dc":["..."]
}
}
GET object/:pid/oai_dc
Use this method to get the object's Dublin Core datastream. See datastream examples.
Param name | Possible values |
---|---|
format | xml |
If the format param is set to 'xml', the datastream would be returned as it is saved in Fedora.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/oai_dc"
Response
{
"metadata": {
"oai_dc":["..."]
}
}
GET object/:pid/index
Use this method to get a summary of the object's metadata. This method is used to fill the index (Solr) so if you want this structure and have a Solr endpoint configured, it would be better to use Solr to get it (it would probably be faster since this method is only partially cached).
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/index"
Response
{
"index": {
"datastreams": [
"GEO",
"TECHINFO",
"THUMBNAIL",
"DC_P",
"DC_OAI",
"DC",
"STYLESHEET",
"OCTETS",
"RELS-EXT",
"MODS"
],
"dc_description_": [
"Bestand der Kartensammlung der Fachbereichsbibliothek Geographie und Regionalforschung, Universität Wien"
],
"dc_publisher": [
"Lechner",
"Wien"
],
"_updated": 1472033039,
"dc_description_eng": [
"Scale 1:25000"
],
"dc_creator": [
"Schaffer, Franz"
],
"dc_identifier": [
"AC04280778"
],
"size": 1018915252,
"pid": "o:99038",
"cmodel": "Picture",
"bbox": [
"ENVELOPE(48.1177777777778, 48.3225, 16.5775, 16.1816666666667)"
],
"bib_roles_pers_aut": [
"Franz Schaffer"
],
"dc_relation": [
"20151112"
],
"bib_publisherlocation": [
"Wien"
],
"owner": "phaidrs5",
"dc_rights": [
"http://creativecommons.org/publicdomain/mark/1.0/"
],
"dc_title": [
"Geologische Karte der k.k. Reichshaupt- und Residenzstadt Wien"
],
"resourcetype": "image",
"dc_date": [
"1905"
],
"latlon": [
"16.3795833333334,48.2201388888889"
],
"dc_language": [
"ger"
],
"modified": "2015-11-19T20:45:31.113Z",
"dc_subject": [
"Geologie",
"Karte"
],
"bib_published": [
"1905"
],
"created": "2015-11-19T20:44:23.306Z",
"ispartof": [
"o:122513"
],
"bib_publisher": [
"Lechner"
],
"dc_description": [
"Bestand der Kartensammlung der Fachbereichsbibliothek Geographie und Regionalforschung, Universität Wien",
"Scale 1:25000",
"Maßstab 1:25000",
"1 Kt."
],
"dc_description_deu": [
"Maßstab 1:25000"
]
},
"status": 200
}
GET object/:pid/id
Get a list of identifiers that are saved in Dublin Core as http://purl.org/dc/terms/identifier.
Example
curl -X GET "https://services.phaidra.univie.ac.at/api/object/o:424554/id"
Response
{
"alerts": [],
"ids": [
"hdl:11353/10.424554"
],
"status": 200
}
GET object/:pid/related
This method returns all objects which are in some relation to the object specified in url.
Param name | Note |
---|---|
relation | Specifies the relation which should be returned, see Relations |
from | nr of entries to skip (paging) |
limit | nr of entries to return (paging) |
right | searches for the relation in opposite direction (eg for hasCollectionMember: 0 will return a list of objects which are members of this object/collection, 1 will return a list of objects/collections where the object is a member) |
fields | fields from the index which should be returned. Only works for fields=dc.description . The title field is returned by default. The preferred title and description fields are the Italian ones. |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/related?relation=info%3Afedora%2Ffedora-system%3Adef%2Frelations-external%23hasCollectionMember"
Response
{
"hits": "3",
"alerts": [],
"objects": [
{
"cmodel": "cmodel:Asset",
"pid": "o:62026",
"title": "test 2",
"titles": [{"lang":"ita","text":"test 2"}]
},
{
"cmodel": "cmodel:PDFDocument",
"pid": "o:16083",
"title": "test",
"titles": [{"lang":"ita","text":"test"}]
},
{
"cmodel": "cmodel:PDFDocument",
"pid": "o:16066",
"title": "resource test",
"titles": [{"lang":"ita","text":"risorsa test"}]
}
],
"status": 200
}
GET object/:pid/state
This method returns the state of the object. Possible values: Active, Inactive, Deleted
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/state"
Response
{
"alerts": [],
"state": "Active",
"status": 200
}
GET object/:pid/octets
This call works only for smaller objects. The API (Mojolicious) does not fully support stream through because it makes no flow control.
Example
curl -X GET -H "X-XSRF-TOKEN: 944afd4c0b303b482e3a9cb5e31a061e76f350f3" "https://services.phaidra-sandbox.univie.ac.at/api/object/o:147438/octets"
Response
The response contains data.
GET object/:pid/fulltext
Use this method to get the object's fulltext datastream. This basically contains plain text data. It is only available in plain text format so you have to call it with the format=txt
parameter.
Param name | Possible values |
---|---|
format | txt |
Example
curl -X GET -H "X-XSRF-TOKEN: 944afd4c0b303b482e3a9cb5e31a061e76f350f3" "https://services.phaidra-sandbox.univie.ac.at/api/object/o:147438/fulltext" -d "format=txt"
Response
The response contains data.
GET object/:pid/diss/:bdef/:method
Use this method to get the object's datastreams by Fedora disseminators for the given bdef service definition and associated method name. Authentication is mandatory if the object is locked.
Example
curl -X GET -H "X-XSRF-TOKEN: 944afd4c0b303b482e3a9cb5e31a061e76f350f3" "https://services.phaidra-sandbox.univie.ac.at/api/object/o:147438/diss/Content/get"
Response
The response contains data.
POST picture/create, document/create, video/create, audio/create
See also Cookbook.
Param | Value |
---|---|
file | [upload file via "multipart/form-data"] |
metadata | See example for the metadata.json structure |
Optional parameter: mimetype (if not provided, heuristics is used on server side).
Request example:
curl -X POST -u username:password -F "[email protected]" -F "[email protected]" https://services.phaidra-sandbox.univie.ac.at/api/picture/create
Response example:
{
"alerts":[],
"pid":"o:1",
"status":200
}
POST object/create
See also Cookbook.
Example:
curl -X POST -u username:password https://services.phaidra-sandbox.univie.ac.at/api/object/create
Response:
{
"alerts":[],
"pid":"o:1",
"status":200
}
POST object/:pid/modify
Possible parameters (all are optional)
Param | Value |
---|---|
state | A (= Active), I (= Inactive), D (= Deleted) |
label | some string, at the moment it isn't used in Phaidra |
ownerid | owner's username |
logmessage | some string |
lastmodifieddate | a date in ISO format |
Example:
curl -X POST -u username:password https://services.phaidra-sandbox.univie.ac.at/api/object/o:1/modify -F 'state=A'
Response
{
"alerts":[],
"status":200
}
POST object/:pid/delete
This method permanently deletes the object from the repository.
Example:
curl -X POST -u username:password https://services.phaidra-sandbox.univie.ac.at/api/object/o:1/delete
Response
{
"alerts": [],
"status": 200
}
POST object/:pid/metadata
Use this method to save any of the primary metadata datastreams (currently uwmetadata, mods, geo and rights) one at a time or all at once.
The metadata (JSON) can be sent as a form parameter (named 'metadata') or as a file parameter (also named 'metadata').
The particular metadata datastream has to be a child of the 'metadata' node, eg:
{
"metadata": {
"uwmetadata": ["..."],
"rights": ["..."]
}
}
See also datastream examples.
Example
curl -X POST -u username:password https://services.phaidra-sandbox.univie.ac.at/api/object/o:1/metadata -F [email protected]
Response
{
"alerts": [
{
"msg": "Metadata for o:1 saved successfully (5 s)",
"type": "success"
}
],
"status": 200
}
POST object/:pid/data
This method can be used to add actual data (OCTETS datastream) to the object (eg a jpeg, a video or a PDF). Data can be added only once. The data are sent as a file parameter (named 'file').
It is recommended to send the mimetype parameter. If not sent, heuristics will be used to infer the MIME type.
Param | Note |
---|---|
file | the file containing the data |
mimetype | eg 'image/tif' (optional) |
Example
curl -X POST -u username:password -F "mimetype=image/tif" -F "[email protected]" https://services.phaidra-sandbox.univie.ac.at/api/object/o:1/data
Response
{
"alerts":[],
"status":200
}
POST object/:pid/datastream/:dsid
With this method, you can add or modify any datastream as long as the Fedora policies allow it. The method checks if the datastream exists and then decides to add (if it does not exist) or modify it (if it exists already). Consider using the dedicated methods for the datastreams for which there is an API method available (like object/:pid/rights, etc).
As parameters, the method takes the parameters for the underlying Fedora method.
Param | Note |
---|---|
mimetype | eg 'image/tif' (optional) |
location | location of managed or external datastream content |
dslabel | For OCTETS datastream it should be the original filename (eg my_test.pdf). For other datastreams any string, it's not used by Phaidra. |
dscontent | the content, e.g. the XML |
controlgroup | one of "X", "M", "R", or "E" (Inline XML, Managed Content, Redirect, or External Referenced) |
Example
curl -X POST -u username:password -F "mimetype=application/xml" -F "controlgroup=X" -F "[email protected]" https://services.phaidra-sandbox.univie.ac.at/api/object/o:1/datastream/MYDATASTREAM
Response
{
"alerts": [
{
"msg": "Adding MYDATASTREAM for o:1 successful.",
"type": "success"
}
],
"status":200
}
GET object/:pid/rights
Use this method to get the object's access restrictions. You have to be authorized to do this, so this method expects authentication.
Example
curl -X GET -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:99038/rights"
Response
{
"metadata": {
"rights": {
"username": [
{
"value": "hudakr4",
"expires": "2016-08-25T14:31:34Z"
}
]
},
"alerts": [],
"status": 200
}
}
POST object/:pid/rights
This method saves the object's access restrictions. See datastream examples to see how the metadata.json should look like. Metadata can be sent as a form param or as a file param.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/rights" -F "[email protected]"
Response
{
"alerts": [
{
"msg": "RIGHTS for o:19 saved successfully (1.882326 s)",
"type": "success"
}
]
}
POST object/:pid/geo
This method saves information about the object's geolocation. See datastream examples to see how the metadata.json should look like.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/geo" -F "[email protected]"
Response
{
"alerts": [
{
"msg": "GEO for o:19 saved successfully (1.882326 s)",
"type": "success"
}
]
}
POST object/:pid/annotations
This method can save the object's annotations. The format chosen is taken from IIPMooViewer. See datastream examples to see how the annotations.json should look like.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/annotations" -F "[email protected]"
Response
{
"alerts": [
{
"msg": "ANNOTATIONS for o:19 saved successfully (1.882326 s)",
"type": "success"
}
]
}
POST object/:pid/uwmetadata
This method saves the object's metadata if you are using the uwmetadata as a metadata structure. See datastream examples to see how the metadata.json should look like.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/uwmetadata" -F "[email protected]"
Response
{
"alerts": [
{
"msg": "UWMETADATA for o:19 saved successfully",
"type": "success"
}
]
}
POST object/:pid/mods
This method saves the object's metadata if you are using the mods as a metadata structure. See datastream examples to see how the metadata.json should look like.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/mods" -F "[email protected]"
Response
{
"alerts": [
{
"msg": "MODS for o:19 saved successfully",
"type": "success"
}
]
}
POST object/:pid/id/add
Use to add an identifier to the RELS-EXT datastream (as a relationship with the predicate 'http://purl.org/dc/terms/identifier'). This way it's available in the triplestore, Dublin Core and index automatically. It's not going to be added to metadata (uwmetadata, mods). IDs added this way are usually added by Phaidra (like Handles), while the IDs in metadata are added and controlled by the user.
Param | Value |
---|---|
hdl | the handle identifier (eg: 11353/10.448537) |
doi | the doi identifier (eg: 10.5194/bg-11-1491-2014) |
urn | the urn identifier (eg: urn:nbn:at:at-ubw-30020.78240.320264-3) |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/id/add" -F "hdl=11353/10.448537"
Response
{
"alerts": [],
"status": 200
}
POST object/:pid/id/remove
Removes identifier from the RELS-EXT datastream.
Param | Value |
---|---|
hdl | the handle identifier (eg: 11353/10.448537) |
doi | the doi identifier (eg: 10.5194/bg-11-1491-2014) |
urn | the urn identifier (eg: urn:nbn:at:at-ubw-30020.78240.320264-3) |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/id/remove" -F "hdl=11353/10.448537"
Response
{
"alerts": [],
"status": 200
}
POST object/:pid/relationship/add
Use to add a relationship to the RELS-EXT datastream. This way it's available in the triplestore, Dublin Core and index automatically. Adding some system relationships (like hasModel) might be restricted. See Relations for a list of supported relationships.
Param | Value |
---|---|
predicate | the relationship (eg: 'info:fedora/fedora-system:def/model#hasModel' or 'http://phaidra.org/XML/V1.0/relations#isBackSideOf') |
object | the value or the identifier of the related object in the repository (eg: 'info:fedora/cmodel:Picture' or 'info:fedora/o:18' ) |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/relationship/add" -F "predicate=http://phaidra.org/XML/V1.0/relations#isBackSideOf" -F "object=info:fedora/o:18"
Response
{
"alerts": [],
"status": 200
}
POST object/:pid/relationship/remove
Use to remove a relationship from the RELS-EXT datastream. Removing some system relationships (like hasModel) might be restricted. See Relations for a list of supported relationships.
Param | Value |
---|---|
predicate | the relationship (eg: 'info:fedora/fedora-system:def/model#hasModel' or 'http://phaidra.org/XML/V1.0/relations#isBackSideOf') |
object | the value or the identifier of the related object in the repository (eg: 'info:fedora/cmodel:Picture' or 'info:fedora/o:18' ) |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/relationship/remove" -F "predicate=http://phaidra.org/XML/V1.0/relations#isBackSideOf" -F "object=info:fedora/o:18"
Response
{
"alerts": [],
"status": 200
}
POST object/:pid/dc
Triggers the update of the object's Dublin Core datastreams (DC, DC_P, DC_OAI).
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/dc"
Response
{
"results": [
{
"pid": "o:19",
"status": 200
}
]
}
POST object/:pid/index
Triggers the update of the object's index (Solr).
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/object/o:19/index"
Response
{
"results": [
{
"pid": "o:19",
"status": 200
}
]
}
GET uwmetadata/tree
Returns the uwmetadata structure with all nodes, labels, dictionaries, etc. The tree can be seen here.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/tree"
Response
{
"alerts": [],
"tree": ["..."],
"languages": ["..."],
"status": 200
}
POST uwmetadata/json2xml
Transforms the uwmetadata structure from JSON to XML. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/json2xml" -F "[email protected]"
POST uwmetadata/xml2json
Transforms the uwmetadata structure from XML to JSON (basic mode is the default). See datastream examples to see how the XML looks like and how the JSON looks like.
The XML has to be sent in the request body as raw data.
Param name | Possible values |
---|---|
mode (optional) | full, basic |
If the mode is 'full', the whole tree with filled-in values will be created.
Example
curl -X POST --data-binary '< uwmetadata xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/xml2json"
POST uwmetadata/validate
Validates the uwmetadata structure in XML. See datastream examples to see how the XML looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< uwmetadata xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/validate"
POST uwmetadata/json2xml_validate
Transforms the uwmetadata structure from JSON to XML and validates it. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/json2xml_validate" -F "[email protected]"
POST uwmetadata/compress
Transforms the uwmetadata structure from its full format to its basic format (no empty nodes). See datastream examples. The full format might be better for implementing an editor, but it's too large for storing.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/compress" -F "[email protected]"
POST uwmetadata/decompress
Transforms the uwmetadata structure from its basic format (no empty nodes) to its full format. See datastream examples. The full format might be better for implementing an editor, but it's too large for storing.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/uwmetadata/decompress" -F "[email protected]"
GET mods/tree
Returns the MODS structure with all nodes, dictionaries, etc. The tree can be seen here.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/mods/tree"
Response
{
"alerts": [],
"tree": ["..."],
"languages": ["..."],
"vocabularies": ["..."],
"vocabularies_mapping": ["..."],
"status": 200
}
POST mods/json2xml
Transforms the mods structure from JSON to XML. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/mods/json2xml" -F "[email protected]"
POST mods/xml2json
Transforms the MODS structure from XML to JSON. See datastream examples to see how the XML looks like and how the JSON looks like.
The XML has to be sent in the request body as raw data.
Param | Value |
---|---|
mode (optional) | full, basic |
Example
curl -X POST --data-binary '< mods xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/mods/xml2json"
POST mods/validate
Validates the MODS structure in XML. See datastream examples to see how the XML looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< mods xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/mods/validate"
POST mods/json2xml_validate
Transforms the mods structure from JSON to XML and validates it. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/mods/json2xml_validate" -F "[email protected]"
POST rights/json2xml
Transforms the rights structure from JSON to XML. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/rights/json2xml" -F "[email protected]"
POST rights/xml2json
Transforms the rights structure from XML to JSON. See datastream examples to see how the XML looks like and how the JSON looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< rights xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/rights/xml2json"
POST rights/validate
Validates the rights structure in XML. See datastream examples to see how the XML looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< rights xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/rights/validate"
POST rights/json2xml_validate
Transforms the rights structure from JSON to XML and validates it. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/rights/json2xml_validate" -F "[email protected]"
POST geo/json2xml
Transforms the geo structure from JSON to XML. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/geo/json2xml" -F "[email protected]"
POST geo/xml2json
Transforms the geo structure from XML to JSON. See datastream examples to see how the XML looks like and how the JSON looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< geo xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/geo/xml2json"
POST geo/validate
Validates the geo structure in XML. See datastream examples to see how the XML looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< geo xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/geo/validate"
POST geo/json2xml_validate
Transforms the geo structure from JSON to XML and validates it. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/geo/json2xml_validate" -F "[email protected]"
POST annotations/json2xml
Transforms the annotations structure from JSON to XML. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/annotations/json2xml" -F "[email protected]"
POST annotations/xml2json
Transforms the annotations structure from XML to JSON. See datastream examples to see how the XML looks like and how the JSON looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< annotations xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/annotations/xml2json"
POST annotations/validate
Validates the annotations structure in XML. See datastream examples to see how the XML looks like.
The XML has to be sent in the request body as raw data.
Example
curl -X POST --data-binary '< annotations xml here >' "https://services.phaidra-sandbox.univie.ac.at/api/annotations/validate"
POST annotations/json2xml_validate
Transforms the annotations structure from JSON to XML and validates it. See datastream examples to see how the metadata.json should look like and how the XML looks like.
Example
curl -X POST "https://services.phaidra-sandbox.univie.ac.at/api/annotations/json2xml_validate" -F "[email protected]"
GET languages
Get the vocabulary of the languages which can be used to eg define the language of a metadata field.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/languages"
Response
{
"alerts": [],
"languages": {
"ne": {
"en": "Nepali",
"de": "Nepalisch",
"it": "Nepalese",
"sr": "nepalski"
},
"..."
}
}
GET licenses
Returns licences that can be used to assign a license to an object. In uwmetadata, the value of the 'lid' field is used, in mods the license URI.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/licenses"
Response
{
"alerts": [],
"licenses": [
{
"link_info": "http://creativecommons.org/licenses/by/2.0/at/deed",
"descriptions": {
"en": "You are free:<br />to copy, distribute, display, and perform the work<br />to make derivative works<br /><br />Under the following conditions:<br />Attribution. You must give the original author credit.<br /><br />- For any reuse or distribution, you must make clear to others the licence terms of this work.<br />- Any of these conditions can be waived if you get permission from the copyright holder.<br />- Nothing in this licence impairs or restricts the author's moral rights.",
"de": "Namensnennung 2.0 Österreich<br /><br />Attribution 2.0 Austria (by)<br /><br />Wenn Sie Ihren Schutzgegenstand unter den Bedingungen dieser Lizenz anbieten, gestatten Sie jedem Lizenznehmer, Ihren Schutzgegenstand in körperlicher oder unkörperlicher Form zu verwerten, insbesondere<br />- zu vervielfältigen, zu verbreiten, vorzuführen, zu senden und der Öffentlichkeit zur Verfügung zu stellen;<br />- zu bearbeiten und die Bearbeitungen zu verwerten.<br /><br />Der Lizenznehmer muss Ihren Namen in Verbindung mit Ihrem Schutzgegenstand stets in der von Ihnen festgelegten Weise nennen.<br /><br />Im Falle einer Verbreitung muss der Lizenznehmer anderen die Lizenzbedingungen, unter welche dieser Schutzgegenstand fällt, mitteilen.<br />Jede der vorgenannten Bedingungen kann aufgehoben werden, sofern Sie als Rechteinhaber Ihre Einwilligung dazu erteilen.<br />Diese Lizenz lässt die Urheberpersönlichkeitsrechte unberührt."
},
"link_uri": "http://creativecommons.org/licenses/by/2.0/at/",
"lid": 2,
"link_text": "http://creativecommons.org/licenses/by/2.0/at/legalcode",
"labels": {
"en": "CC BY 2.0 AT",
"de": "CC BY 2.0 AT"
}
},
"..."
]
}
GET directory/get_org_units
Get the list of the org units. These are used eg to find objects explicitly associated with them or to restrict rights for a particular org unit.
Param | Value |
---|---|
parent_id | Id of the parent unit. If not set, returns the top-level units. |
values_namespace | If provided, the values returned (in the 'uri' field) will be prefixed with the value of this parameter |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/get_org_units" -d "values_namespace=http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/organization/voc_faculty"
Response
{
"terms": [
{
"en": "A47: Faculty of Psychology",
"de": "A47: Fakultat fur Psychologie",
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/organization/voc_faculty/A47"
},
"..."
]
}
GET directory/get_parent_org_unit_id
Get the id of the parent of an org unit, e.g. id of a faculty for a particular institute, where institute will be specified by 'child_id' parameter.
Param | Value |
---|---|
child_id | id of the child unit |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/get_parent_org_unit_id" -d "child_id=A471"
Response
{
"parent_id": "A47"
}
GET directory/get_study
Get the list of studies in a study plan.
Param | Value |
---|---|
spl | id of the child unit |
@ids (array) | study ids |
values_namespace | If provided, the values returned (in the 'uri' field) will be prefixed with the value of this parameter |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/get_study" -F "spl=32"
Response
{
"terms": [
{
"de": "057",
"uri": "057"
},
{
"de": "085",
"uri": "085"
},
{
"de": "033",
"uri": "033"
},
{
"de": "067",
"uri": "067"
},
{
"de": "996",
"uri": "996"
},
{
"de": "050",
"uri": "050"
},
{
"de": "360",
"uri": "360"
},
{
"de": "091",
"uri": "091"
},
{
"de": "449",
"uri": "449"
},
{
"de": "066",
"uri": "066"
}
]
}
GET directory/get_study_name
Param | Value |
---|---|
spl | id of the child unit |
@ids (array) | study ids |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/get_study" -F "spl=32" -F "ids=067"
Response
{
"study_name": {
"de": "Individuelles Magisterstudium Pharmazie "
}
}
GET directory/user/:username/data
Get user's name, affiliation and other data
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/user/hudakr4/data"
Response
{
"user_data": {
"org_units_l1": [
"0"
],
"firstname": "Rastislav",
"lastname": "Hudak",
"org_units_l2": [
"A140"
],
"username": "hudakr4"
}
}
GET directory/user/:username/name
Get user's name
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/user/hudakr4/name"
Response
{
"name": "Rastislav Hudak"
}
GET directory/user/:username/email
Get the user's email
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/directory/user/hudakr4/email"
Response
{
"email": "[email protected]"
}
GET directory/user/search
Searches the user database. Only the first 50 results are returned.
Param | Value |
---|---|
q | query (it will be automatically suffixed with *) |
Example
curl -X GET -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/directory/user/search" -F "q=hud"
Response
{
"hits": 1,
"accounts": [
{
"uid": "hudakr4",
"value": "Hudak, Rastislav",
"type": "uuid"
}
]
}
GET search/triples
Param name | Note |
---|---|
q | triple query (eg 'info:fedora/o:19 * *') |
limit | nr of entries to return |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/search/triples" -d "q=<info:fedora/o:19> * *"
Response
{
"alerts": [],
"status": 200,
"result": [
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#lastModifiedDate>",
"\"2016-08-25T09:25:20.218Z\"^^<http://www.w3.org/2001/XMLSchema#dateTime>"
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/title>",
"\"OpenAIRE collection\"@eng"
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/creator>",
"\"Admin, A. (Admin)\""
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/relations-external#hasCollectionMember>",
"<info:fedora/o:16083>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/relations-external#hasCollectionMember>",
"<info:fedora/o:16066>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#state>",
"<info:fedora/fedora-system:def/model#Active>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#hasModel>",
"<info:fedora/cmodel:Collection>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#hasModel>",
"<info:fedora/fedora-system:FedoraObject-3.0>"
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/language>",
"\"eng\""
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#label>",
"\"New object created Mon Jun 25 17:46:02 2012\""
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/date>",
"\"2012-06-25T15:46:02.325Z\""
],
[
"<info:fedora/o:19>",
"<http://www.openarchives.org/OAI/2.0/setSpec>",
"\"ec_fundedresources\""
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/UWMETADATA>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/RELS-EXT>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/STYLESHEET>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/DC>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/THUMBNAIL>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/POLICY>"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/view#disseminates>",
"<info:fedora/o:19/RIGHTS>"
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/type>",
"\"Collection\""
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/rights>",
"\"All rights reserved\""
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#ownerId>",
"\"PhaidraAdmin\""
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/identifier>",
"\"http://phaidra-sandbox.univie.ac.at/o:19\""
],
[
"<info:fedora/o:19>",
"<http://purl.org/dc/elements/1.1/description>",
"\"OpenAIRE collection created to collect objects which are supposed to be available via ec_fundedresources set in oaiprovider.\"@eng"
],
[
"<info:fedora/o:19>",
"<info:fedora/fedora-system:def/model#createdDate>",
"\"2012-06-25T15:46:02.325Z\"^^<http://www.w3.org/2001/XMLSchema#dateTime>"
],
[
"<info:fedora/o:19>",
"<http://www.openarchives.org/OAI/2.0/setName>",
"\"OpenAIRE\""
],
[
"<info:fedora/o:19>",
"<http://www.openarchives.org/OAI/2.0/itemID>",
"<info:fedora/oai:univie.ac.at:o:19>"
]
]
}
GET terms/label
Get labels for a particular term using its URI as a parameter. It could be a term of a classification or a vocabulary (any type, even licenses and organisational units).
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/terms/label" -d "uri=http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/347"
Response
{
"alerts": [],
"status": 200,
"labels": {
"nonpreferred": [],
"upstream_identifier": "1",
"term_id": null,
"labels": {
"en": "NATURAL SCIENCES",
"de": "NATURWISSENSCHAFTEN"
}
}
}
GET terms/children
Get children for a particular classification term using its URI as a parameter.
Param name | Note |
---|---|
uri | Example: http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/347 |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/terms/children" -d "uri=http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1"
Response
{
"alerts": [],
"status": 200,
"terms": [
{
"upstream_identifier": "4",
"term_id": null,
"labels": {
"en": "AGRICULTURE & FORESTRY, VETERINARY MEDICINE",
"de": "LAND- UND FORSTWIRTSCHAFT, VETERINÄRMEDIZIN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/193"
},
{
"upstream_identifier": "3",
"term_id": null,
"labels": {
"en": "HUMAN MEDICINE",
"de": "HUMANMEDIZIN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/651"
},
{
"upstream_identifier": "6",
"term_id": null,
"labels": {
"en": "HUMANITIES",
"de": "GEISTESWISSENSCHAFTEN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/1"
},
{
"upstream_identifier": "1",
"term_id": null,
"labels": {
"en": "NATURAL SCIENCES",
"de": "NATURWISSENSCHAFTEN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/347"
},
{
"upstream_identifier": "5",
"term_id": null,
"labels": {
"en": "SOCIAL SCIENCES",
"de": "SOZIALWISSENSCHAFTEN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/1225"
},
{
"upstream_identifier": "2",
"term_id": null,
"labels": {
"en": "TECHNICAL SCIENCES",
"de": "TECHNISCHE WISSENSCHAFTEN"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/909"
}
]
}
GET terms/parent
Get parent for a particular classification term using its URI as a parameter.
Param name | Note |
---|---|
uri | Example: http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/540 |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/terms/parent" -d "uri=http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/540"
Response
{
"parent": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1/508"
}
GET terms/search
Returns terms matching query in any language found in any of the available classifications.
Param name | Note |
---|---|
q | text query |
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/terms/search" -d "q=query"
Response
{
"alerts": [],
"status": 200,
"terms": [
{
"hits": 0,
"terms": [],
"labels": {
"en": "OSNO - Op�ta sistematizacija nau?nih oblasti",
"de": "OSNO - Op�ta sistematizacija nau?nih oblasti",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_11"
},
{
"hits": 2,
"terms": [
{
"upstream_identifier": "2603701",
"term_id": "945393",
"preferred": "1",
"labels": {
"en": "Query Creek",
"de": "Query Creek"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_7/398680"
}
],
"labels": {
"en": "Getty Thesaurus of Geographic Names",
"de": "Getty Thesaurus of Geographic Names",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_7"
},
{
"hits": 6,
"terms": [
{
"upstream_identifier": "H.2.3.4",
"term_id": null,
"preferred": "1",
"labels": {
"en": "Query languages",
"de": "Query languages"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_2/2422"
},
{
"upstream_identifier": "H.3.3.3",
"term_id": null,
"preferred": "1",
"labels": {
"en": "Query formulation",
"de": "Query formulation"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_2/2465"
},
{
"upstream_identifier": "H.2.4.6",
"term_id": null,
"preferred": "1",
"labels": {
"en": "Query processing",
"de": "Query processing"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_2/2430"
}
],
"labels": {
"en": "The ACM Computing Classification System [1998 Version]",
"de": "The ACM Computing Classification System [1998 Version]",
"it": "The ACM Computing Classification System [1998 Version]",
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_2"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "ÖFOS",
"de": "ÖFOS",
"it": null,
"ru": "ÖFOS",
"nl": "ÖFOS",
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_1"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "ÖFOS 2012",
"de": "ÖFOS 2012",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_16"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Dewey Decimal Classification",
"de": "Dewey-Dezimalklassifikation",
"it": "Classificazione decimale Dewey",
"ru": null,
"nl": null,
"sr": "Deweyev decimalni sistem klasifikacije"
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_13"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Getty Union List of Artist Names",
"de": "Getty Union List of Artist Names",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_6"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "EuroVoc 4.2",
"de": "EuroVoc 4.2",
"it": "EuroVoc 4.2",
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_3"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "European Projects",
"de": "European Projects",
"it": "European Projects",
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_9"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Conferences",
"de": null,
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_12"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "BIC Standard Subject Categories",
"de": null,
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_14"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "BIC Standard Subject Qualifiers",
"de": null,
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_15"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "University of Vienna",
"de": "Universität Wien",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_8"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Physics and Astronomy Classification Scheme",
"de": "Physics and Astronomy Classification Scheme",
"it": "Physics and Astronomy Classification Scheme",
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_4"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Basisklassifikation",
"de": "Basisklassifikation",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_10"
},
{
"hits": 0,
"terms": [],
"labels": {
"en": "Getty Art & Architecture Thesaurus",
"de": "Getty Art & Architecture Thesaurus",
"it": null,
"ru": null,
"nl": null,
"sr": null
},
"uri": "http://phaidra.univie.ac.at/XML/metadata/lom/V1.0/classification/cls_5"
}
]
}
GET collection/:pid/members
Returns members of collection ordered if the COLLECTIONORDER datastream is available. Consider using the get related objects method instead to get the members with a title.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/collection/o:19/members"
Response
{
"alerts": [],
"metadata": {
"members": [
{
"pid": "o:98076",
"pos": null
},
{
"pid": "o:26111",
"pos": null
},
{
"pid": "o:18",
"pos": null
},
{
"pid": "o:62026",
"pos": null
}
]
}
}
POST collection/create
Use to create collection object in one method call. In the metadata parameter, you have to provide both: bibliographical metadata and members.
Param | Value |
---|---|
metadata | See example for the metadata.json structure. Additionally, the structure should contain 'members' (see collection members example). You can define positions but it's optional. |
Request example:
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/collection/create" -F "[email protected]"
Response
{
"alerts": [],
"status": 200,
"pid": "o:19"
}
POST collection/:pid/members/add
Used to add members to a collection.
Param | Value |
---|---|
metadata | Have to contain 'members' with an array of members to add (see collection members example). You can define positions but it's optional. |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/collection/o:19/members/add" -F "[email protected]"
Response
{
"alerts": [],
"status": 200
}
POST collection/:pid/members/remove
Used to remove members from a collection.
Param | Value |
---|---|
metadata | Have to contain 'members' with an array of members to remove (see collection members example). |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/collection/o:19/members/remove" -F "[email protected]"
Response
{
"alerts": [],
"status": 200
}
POST collection/:pid/members/order
Used to change the order of collection members.
Param | Value |
---|---|
metadata | Have to contain 'members' with an array of members to remove (see collection members example) with positions defined |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/collection/o:19/members/order" -F "[email protected]"
Response
{
"alerts": [],
"status": 200
}
POST collection/:pid/members/:itempid/order/:position
Changes order of a single collection member. Practical eg for drag&drop. It is a POST method only to emphasize that it changes the structure, but it does not have any parameters.
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/collection/o:19/members/o:18/order/2"
Response
{
"alerts": [],
"status": 200
}
POST dc
Triggers the update of Dublin Core datastreams (DC, DC_P, DC_OAI) for every object in the provided list.
Param | Value |
---|---|
pids | json structure with and array of pids (eg { "pids": ["o:19","o:18"] } ) |
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/dc" -F "[email protected]"
Response
{
"results": [
{
"pid": "o:19",
"res": "OK"
},
{
"pid": "o:18",
"res": "OK"
}
]
}
POST index
Triggers the update of the index in the configured mongo database for every object in the provided list.
Param | Value |
---|---|
pids | json structure with and array of pids (eg { "pids": ["o:19","o:18"] } ) |
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/index" -F "[email protected]"
Response
{
"results": [
{
"pid": "o:19",
"status": 200
},
{
"pid": "o:18",
"status": 200
}
]
}
GET stats/:pid
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/stats/o:19"
Response
{
"stats": {
"downloads": "0",
"detail_page": "5"
}
}
GET stats/:pid/downloads
Returns an integer. Useful eg for ajax content update without any response parsing necessary.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/stats/o:19/downloads"
Response
0
GET stats/:pid/detail_page
Returns an integer. Useful eg for ajax content update without any response parsing necessary.
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/stats/o:19/detail_page"
Response
5
GET utils/get_all_pids
Example
curl -X GET "https://services.phaidra-sandbox.univie.ac.at/api/utils/get_all_pids"
Response
{
"pids": ["..."]
}
POST imageserver/:pid/process
If image server is configured, creates a job in the image server's database to process a particular pid.
Param name | Possible values | Note |
---|---|---|
ds | 'USERTHUMB' | By default, OCTETS is processed. This is a possibility to define another datastream. |
skipexisting | 1 | If a job for this pid (and this datastream, if the ds parameter is set) already exists, a new job won't be created and an existing job will be returned |
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/imageserver/o:19/process"
Response
[
{
"idhash":"8bd93aa73d40c3c1440353294c2088dc47d6c66c",
"pid":"o:19"
}
]
POST imageserver/process
If image server is configured, creates a job in the image server's database to process all the pids from the provided list.
Param | Value | Note |
---|---|---|
pids | JSON structure with an array of pids (eg { "pids": ["o:19","o:18"] } ) |
|
skipexisting | 1 | If a job for a pid already exists, creating a job for this pid will be skipped |
Example
curl -X POST -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/imageserver/process" -F "[email protected]"
Response
[
{
"idhash":"8bd93aa73d40c3c1440353294c2088dc47d6c66c",
"pid":"o:19"
},
{
"idhash":"061b3c7515f255bfed03b5d19256d1e36cbf0ff3",
"pid":"o:18"
}
]
GET imageserver/:pid/status
If image server is configured, returns the record from the image server job database for the pid specified.
Example
curl -X GET -u adminusername:password "https://services.phaidra-sandbox.univie.ac.at/api/imageserver/o:19/status"
Response
{
"curl_lines": [
" % Total % Received % Xferd Average Speed Time Time Time Current",
" Dload Upload Total Spent Left Speed",
"100 64.5M 100 64.5M 0 0 11.3M 0 0:00:05 0:00:05 --:--:-- 13.8M"
],
"image": "/var/www/iipsrv/data/sandbox/9/5/95372eaad9c6c861b0ca81902816e65da0a520da.tif",
"status": "finished",
"created": 1462971570,
"idhash": "95372eaad9c6c861b0ca81902816e65da0a520da",
"conversion": "ok",
"vips_lines": [
"vips /tmp/sandbox/o_19: 5789 x 3897 pixels, 4 threads, 5789 x 1 tiles, 256 lines in buffer",
"vips temp-7: 5789 x 3897 pixels, 4 threads, 5789 x 1 tiles, 256 lines in buffer",
"vips temp-7: done in 0.168s",
"vips /tmp/sandbox/o_1981: done in 0.477s"
],
"_id": "57332cb29d459f1382450000",
"pid": "o:19",
"ts_iso": "20160511T145936",
"agent": "pige"
}
GET imageserver
Proxy for the imageserver API. This is necessary for the frontend. The images at the image server are hashed so that it's possible to restrict access to them. This method checks if the user (if credentials are provided) is authorized to access the image and if it is, it uses the configured secret to create the hash under which image server knows the image. It then accesses the image server proxying all the parameters and proxies back the response.
Example
curl -X GET "https://services.phaidra.univie.ac.at/api/imageserver?IIIF=o:440180.tif/full/256,256/0/default.jpg"
The response contains the data needed by the IIP-compatible viewers.
GET groups
Example
curl -X GET -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/groups"
Response
{
"alerts": [],
"groups": [
{
"created": 1443529100,
"name": "xxx",
"updated": 1443529100,
"groupid": "2BF2E33E-66A4-11E5-A027-6E978F0EBC48"
},
{
"created": 1443529100,
"name": "rasta",
"updated": 1443777146,
"groupid": "2BDB116E-66A4-11E5-A027-6E978F0EBC48"
},
{
"created": 1443529100,
"name": "ttt",
"updated": 1443529100,
"groupid": "2BE683AA-66A4-11E5-A027-6E978F0EBC48"
},
{
"created": 1443529100,
"name": "1111",
"updated": 1444398827,
"groupid": "2BCB96C6-66A4-11E5-A027-6E978F0EBC48"
},
{
"created": 1453367318,
"name": "gr1",
"updated": 1453367347,
"groupid": "8F43FEEA-C01E-11E5-AC29-7B0537B6CEAB"
}
]
}
GET group/:gid
Example
curl -X GET -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/group/8F43FEEA-C01E-11E5-AC29-7B0537B6CEAB"
Response
{
"group": {
"owner": "hudakr4",
"members": [
{
"name": "Rastislav Hudak",
"username": "hudakr4"
}
],
"created": 1453367318,
"_id": {
"$oid": "56a0a0164faa168d07000000"
},
"name": "gr1",
"updated": 1453367347,
"groupid": "8F43FEEA-C01E-11E5-AC29-7B0537B6CEAB"
},
"alerts": []
}
POST group/add
Param | Value |
---|---|
name | text - name of the group |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/group/add" -F "name=blibla"
Response
{
"group": "13F1F574-6BB0-11E6-AA0B-B6775AD3CFB6",
"alerts": []
}
POST group/:gid/remove
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/group/13F1F574-6BB0-11E6-AA0B-B6775AD3CFB6/remove"
Response
{
"alerts": []
}
POST group/:gid/members/add
Param | Value |
---|---|
members | JSON array containing usernames to add |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/group/13F1F574-6BB0-11E6-AA0B-B6775AD3CFB6/members/add" -F "members={"members":["hudakr4"]}"
Response
{
"alerts": []
}
POST group/:gid/members/remove
Param | Value |
---|---|
members | JSON array containing usernames to remove |
Example
curl -X POST -u username:password "https://services.phaidra-sandbox.univie.ac.at/api/group/13F1F574-6BB0-11E6-AA0B-B6775AD3CFB6/members/remove" -F "members={"members":["hudakr4"]}"
Response
{
"alerts": []
}