...
language | bash |
---|
Here are some technical essentials to start using the API
...
When successful, the response will have HTTP status code 201 (Created). Note that when a new representation is created, it is automatically assigned a new version. This new version can be reached directly using a URL which is returned in the location field of the response header. The URL will be of the following format:
Code Block |
---|
https://cloud.europeana.eu/api/records/X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/thumbnail/versions/cd9f0050-3dea-11e6-b03d-fa163e8d4ae3 |
...
In the URL above you should replace 'permission' with one of the values: read, write, delete, administration, all. 'anotherUser' should be replaced with a username.
Friendly URLs
Sometimes it is hard for a client to get the global identifier of a record, generated version name of a representation and generated filename. On the other hand the client has got a local record identifier which is well known. The same may be in case of a filename. In order to access files without retrieving the hard to remember identifiers and names mechanism of friendly URLs was introduced. The idea behind it is to use in URLs well known values (identifiers, names, etc.) always in the same way. Here we will go through the tutorial steps using friendly URLs where it is possible.
Record
Normally when you know the cloud identifier of a record you can access it using URL like this:
Code Block |
---|
https://cloud.europeana.eu/api/records/X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ |
If you remember this record was created for PSNC data provider together with local identifier which was exampleLocalRecord. So now we have only two values: name of the data provider (PSNC) and identifier used by this data provider (exampleLocalRecord). To get access to this record in Europeana Cloud using just these two values we can use friendly URL like this:
Code Block |
---|
curl -X GET -H "Accept: application/json" --user user:password -i https://cloud.europeana.eu/api/data-providers/PSNC/records/exampleLocalRecord |
Representations
Sometimes it is necessary to get access to a specific representation. Again, instead of retrieving the global identifier we can use well known values like data provider name, local record identifier and representation name. Let's display information about the TIFFrepresentation using the friendly URL:
Code Block |
---|
curl -X GET -H "Accept: application/json" --user user:password -i https://cloud.europeana.eu/api/data-providers/PSNC/records/exampleLocalRecord/representations/TIFF |
Files
If you do not want to have files with names generated by the system there is possibility to specify the name in the insert request. We can add a file to TIFF representation and specify a name for it like this:
Code Block |
---|
curl -X POST --user user:password -H "Content-Type: multipart/form-data" -F "mimeType=image/tiff" -F "data=@tiff.tiff" -F "fileName=abc" https://cloud.europeana.eu/api/records/X67WPA7NGCZUKLACPWU3BORRGQUWTKSZNZDICEGZS6IXTRMINOIQ/representations/TIFF/versions/27ae2a60-3ebf-11e6-b03d-fa163e8d4ae3/files |
As you can see the specified filename is abc. Now we can use it to access this file in Europeana Cloud via friendly URL.
Code Block |
---|
|
Future Work and Contact
Europeana Cloud is now in its alpha phase. During the remainder of the project we’ll improve the platform and the API based on the feedback from the community.
...