The purpose of this document is to detail some common example of interacting with the REST API of a running Clowder application.
These instructions will use raw curl
commands to test the Clowder API but you can use:
You can use the Swagger UI to explore existing API endpoints on the system: https://clowder.ncsa.illinois.edu/swagger/
Parameters in the API endpoints will appear in {curly-braces}.
NOTE: It appears as if this list does not include all necessary endpoints. For example, there does not appear to be a way to authenticate without using Swagger's built-in "Authorize" function.
Methods:
If you are just testing a simple case and would like to use your Clowder credentials directly (instead of an API key), you can pass your Clowder credentials using Basic Auth:
$ curl -XPOST 'localhost:9000/api/users/keys?name=testkey' --basic -u 'YourUsername:YourPassword' {"name":"testkey","key":"257be5f9-e685-4dec-8bed-c4c9dccb0b92"} |
NOTE: We recommend using API keys over embedded credentials, as it allows you to more easily revoke access in cases where the system has been compromised.
WARNING: Using this auth method will leave your password in your bash history in plaintext (e.g. try running history | grep basic
)
SECURITY WARNING: NEVER use Basic Auth without HTTPS - your credentials will be submitted in plaintext, and anyone sniffing the network traffic can see your password.
For simplicity, you can manage your User API keys in the Clowder UI:
This will take you to the /profile/viewProfile/{user-id}
view that will list your existing API keys, as well as allowing you to create and delete them:
You can also use the REST API to generate a new API key, but you'll need to authenticate manually first.
These endpoints can be used to create a user-specific API key for interacting with the Clowder API.
Relevant endpoints:
POST /api/users/keys?name={key-name}
To create a new API key with the given name:
$ curl -XPOST 'localhost:9000/api/users/keys?name=testkey' --basic -u 'YourUsername:YourPassword' {"name":"testkey","key":"257be5f9-e685-4dec-8bed-c4c9dccb0b92"} |
You can then attach this key as a query string parameter named key for all subsequent API requests, instead of needing to reauthenticate manually and attaching another cookie.
For example, using a User API key to call the /api/users/keys
endpoint would look like this:
$ curl localhost:9000/api/users/keys?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"name":"testkey","key":"257be5f9-e685-4dec-8bed-c4c9dccb0b92","identityId":{"userId":"YourUsername","providerId":"userpass"}}] |
Relevant endpoints:
GET /api/users/keys
GET /api/users/keys/{key-name}
To retrieve a list of all existing API keys for this user:
$ curl --insecure http://localhost:9000/api/users/keys?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"name":"testkey","key":"257be5f9-e685-4dec-8bed-c4c9dccb0b92","identityId":{"userId":"YourUsername","providerId":"userpass"}}] |
To retrieve a specific API key by name:
$ curl --insecure http://localhost:9000/api/users/keys/testkey?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 {"name":"testkey","key":"257be5f9-e685-4dec-8bed-c4c9dccb0b92","identityId":{"userId":"YourUsername","providerId":"userpass"}} |
Relevant endpoints:
DELETE /api/users/keys/{key-name}
To delete an existing API key:
$ curl --insecure 'http://localhost:9000/api/users/keys/testkey?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92' |
Relevant endpoint:
GET /authenticate/{provider}
Accepted provider
values:
userpass
$ curl --insecure http://localhost:9000/authenticate/userpass -vvv -XPOST --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'username=YourUsername' --data-urlencode 'password=YourPassword' * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 9000 (#0) > POST /authenticate/userpass HTTP/1.1 > Host: localhost:9000 > User-Agent: curl/7.54.0 > Accept: */* > Content-Type: application/x-www-form-urlencoded > Content-Length: 50 > * upload completely sent off: 50 out of 50 bytes < HTTP/1.1 303 See Other < Access-Control-Allow-Origin: * < Location: / < Access-Control-Allow-Headers: < Access-Control-Allow-Methods: * < Access-Control-Allow-Credentials: true < Set-Cookie: id=3656a7a78433b52522cc4cd3d1b42579e76ee46c688faa5e5c4259623dfe83531008669ad7769e600ba9d1d94b2d590710d9c9cc98f6b79728ec2cd6e043f97c6e69d5d21e0ba6f7ff0528fa310bf1f2d5002348e3c2b9957d47905ac030de57b2bd9deffd450b32ee452d4c87543f65476be709ccebb7be3b0773e8488bb496; Path=/; HTTPOnly < Set-Cookie: PLAY_SESSION=; Expires=Mon, 06 Aug 2018 20:54:32 GMT; Path=/; HTTPOnly < Content-Length: 0 < * Connection #0 to host localhost left intact |
The important bit here is the Set-Cookie: id=###### line. You will need to save this response cookie value and pass it in with all subsequent requests. For example, see "Log Out" below.
NOTE: Notice that the POST body here is URL-encoded Form Data, and not JSON.
To log out after you are done:
$ curl --insecure http://localhost:9000/logout -vvv --cookie 'id=3656a7a78433b52522cc4cd3d1b42579e76ee46c688faa5e5c4259623dfe83531008669ad7769e600ba9d1d94b2d590710d9c9cc98f6b79728ec2cd6e043f97c6e69d5d21e0ba6f7ff0528fa310bf1f2d5002348e3c2b9957d47905ac030de57b2bd9deffd450b32ee452d4c87543f65476be709ccebb7be3b0773e8488bb496' * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 9000 (#0) > GET /logout HTTP/1.1 > Host: localhost:9000 > User-Agent: curl/7.54.0 > Accept: */* > Cookie: id=3656a7a78433b52522cc4cd3d1b42579e76ee46c688faa5e5c4259623dfe83531008669ad7769e600ba9d1d94b2d590710d9c9cc98f6b79728ec2cd6e043f97c6e69d5d21e0ba6f7ff0528fa310bf1f2d5002348e3c2b9957d47905ac030de57b2bd9deffd450b32ee452d4c87543f65476be709ccebb7be3b0773e8488bb496 > < HTTP/1.1 303 See Other < Access-Control-Allow-Origin: * < Location: /login < Access-Control-Allow-Headers: < Access-Control-Allow-Methods: * < Access-Control-Allow-Credentials: true < Set-Cookie: id=; Expires=Mon, 06 Aug 2018 20:59:05 GMT; Path=/; HTTPOnly < Set-Cookie: PLAY_SESSION=; Expires=Mon, 06 Aug 2018 20:59:04 GMT; Path=/; HTTPOnly < Content-Length: 0 < * Connection #0 to host localhost left intact |
Make sure to pass in the id cookie value that you received during the "Log In" step above.
NOTE: You will notice that now the Set-Cookie response is settings the id cookie to an empty string - this clears your auth cookie from the browser, so you may discard the cookie that you received above as it may no longer be valid.
Relevant endpoints:
GET /api/spaces
GET /api/spaces/{space_id}/datasets
To list all spaces that you can view:
$ curl --insecure http://localhost:9000/api/spaces?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"id":"5b6a0cf877c86409e0925d85","name":"a space","description":"","created":"Tue Aug 07 16:19:52 CDT 2018"},{"id":"5b21310077c8829cd73f8899","name":"test","description":"","created":"Wed Jun 13 09:58:08 CDT 2018"},{"id":"5b0724b277c85c0c70e371d8","name":"newspace","description":"","created":"Thu May 24 15:46:42 CDT 2018"},{"id":"5ad7b4b777c8a52d73b2ac48","name":"test","description":"","created":"Wed Apr 18 16:12:23 CDT 2018"}] |
To list all datasets within a space:
$ curl --insecure http://localhost:9000/api/spaces/5b0724b277c85c0c70e371d8/datasets?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue Jul 17 15:26:45 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]}] |
Relevant endpoints:
GET /api/datasets
GET /api/datasets/canEdit
GET /api/datasets/{dataset_id}
GET /api/datasets/{dataset_id}/metadata
GET /api/datasets/{dataset_id}/download
Relevant endpoints:
GET /api/datasets
GET /api/datasets/canEdit
To list all datasets that you can view:
$ curl --insecure http://localhost:9000/api/datasets?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue Jul 17 15:26:45 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]},{"id":"5ad7b5b377c8a52d73b2ac5f","name":"test_dataset","description":"","created":"Wed Apr 18 16:16:35 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5ad7b4b777c8a52d73b2ac48"]}] |
To list all datasets that you can edit:
$ curl --insecure http://localhost:9000/api/datasets/canEdit?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue Jul 17 15:26:45 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]},{"id":"5ad7b5b377c8a52d73b2ac5f","name":"test_dataset","description":"","created":"Wed Apr 18 16:16:35 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5ad7b4b777c8a52d73b2ac48"]}] |
Relevant endpoints:
GET /api/datasets/{dataset_id}
GET /api/datasets/{dataset_id}/metadata
To retrieve a single dataset:
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 {"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue Jul 17 15:26:45 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]} |
To retrieve user-defined metadata for this dataset:
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/metadata?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"id":"5b0724b277c85c0c70e371dd","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Alternative Title","uri":"http://purl.org/dc/terms/alternative","type":"string"}},{"id":"5b21425beff884a87ef11887","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Alternative Title","uri":"http://purl.org/dc/terms/alternative","type":"string"}},{"id":"5b21425beff884a87ef11888","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Audience","uri":"http://purl.org/dc/terms/audience","type":"string"}},{"id":"5b0724b277c85c0c70e371de","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Audience","uri":"http://purl.org/dc/terms/audience","type":"string"}},{"id":"5b21425beff884a87ef1188b","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"CSDMS Standard Name","uri":"http://csdms.colorado.edu/wiki/CSN_Searchable_List","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/CSN"}},{"id":"5b0724b277c85c0c70e371df","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"CSDMS Standard Name","uri":"http://csdms.colorado.edu/wiki/CSN_Searchable_List","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/CSN"}},{"id":"5b0724b277c85c0c70e371e0","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Date and Time","uri":"http://purl.org/dc/terms/date","type":"datetime"}},{"id":"5b21425beff884a87ef1188a","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Date and Time","uri":"http://purl.org/dc/terms/date","type":"datetime"}},{"id":"5b0724b277c85c0c70e371e1","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Funding Institution","uri":"http://sead-data.net/terms/FundingInstitution","type":"string"}},{"id":"5b21425beff884a87ef11891","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Funding Institution","uri":"http://sead-data.net/terms/FundingInstitution","type":"string"}},{"id":"5b0724b277c85c0c70e371e2","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"GeoJSON","uri":"http://geojson.org/geojson-spec.html","type":"wkt"}},{"id":"5b21425beff884a87ef11896","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"GeoJSON","uri":"http://geojson.org/geojson-spec.html","type":"wkt"}},{"id":"5b0724b277c85c0c70e371e3","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Grant Number","uri":"http://sead-data.net/terms/GrantNumber","type":"string"}},{"id":"5b21425beff884a87ef11892","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Grant Number","uri":"http://sead-data.net/terms/GrantNumber","type":"string"}},{"id":"5b0724b277c85c0c70e371e4","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"ODM2 Variable Name","uri":"http://vocabulary.odm2.org/variablename","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/sn/odm2"}},{"id":"5b21425beff884a87ef1188c","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"ODM2 Variable Name","uri":"http://vocabulary.odm2.org/variablename","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/sn/odm2"}},{"id":"5b0724b277c85c0c70e371e5","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Primary/Initial Publication","uri":"http://sead-data.net/terms/PrimaryPublication","type":"string"}},{"id":"5b21425beff884a87ef11895","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Primary/Initial Publication","uri":"http://sead-data.net/terms/PrimaryPublication","type":"string"}},{"id":"5b21425beff884a87ef11890","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Principal Investigator(s)","uri":"http://sead-data.net/terms/PrincipalInvestigator","type":"string"}},{"id":"5b0724b277c85c0c70e371e6","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Principal Investigator(s)","uri":"http://sead-data.net/terms/PrincipalInvestigator","type":"string"}},{"id":"5b0724b277c85c0c70e371e7","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"References","uri":"http://purl.org/dc/terms/references","type":"string"}},{"id":"5b21425beff884a87ef11889","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"References","uri":"http://purl.org/dc/terms/references","type":"string"}},{"id":"5b0724b277c85c0c70e371e8","spaceId":"5b0724b277c85c0c70e371d8","json":{"labe* Connection #0 to host localhost left intact l":"Related Publications","uri":"http://sead-data.net/terms/RelatedPublications","type":"string"}},{"id":"5b21425beff884a87ef11893","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Related Publications","uri":"http://sead-data.net/terms/RelatedPublications","type":"string"}},{"id":"5b0724b277c85c0c70e371e9","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"SAS Spatial Geocode","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/geocode","type":"listgeocode","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/geocode","query_parameter":"loc"}},{"id":"5b21425beff884a87ef1188e","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"SAS Spatial Geocode","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/geocode","type":"listgeocode","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/geocode","query_parameter":"loc"}},{"id":"5b0724b277c85c0c70e371ea","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"SAS Variable Name","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/vars","type":"scientific_variable","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/vars/unit/udunits2","query_parameter":"term"}},{"id":"5b21425beff884a87ef1188d","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"SAS Variable Name","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/vars","type":"scientific_variable","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/vars/unit/udunits2","query_parameter":"term"}},{"id":"5b0724b277c85c0c70e371eb","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Time Periods","uri":"http://purl.org/dc/terms/PeriodOfTime","type":"string"}},{"id":"5b21425beff884a87ef11894","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Time Periods","uri":"http://purl.org/dc/terms/PeriodOfTime","type":"string"}},{"id":"5b21425beff884a87ef1188f","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Unit","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/unit/udunits2","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/unit/udunits2"}},{"id":"5b0724b277c85c0c70e371ec","spaceId":"5b0724b277c85c0c70e371d8","json":{"label":"Unit","uri":"http://ecgs.ncsa.illinois.edu/gsis/sas/unit/udunits2","type":"list","definitions_url":"http://ecgs.ncsa.illinois.edu/gsis/sas/unit/udunits2"}}] |
Relevant endpoints:
GET /api/datasets/{dataset_id}/download
To download an entire dataset as a .zip file:
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/download?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 E?Mdata//_info.jsonE??n?0 ??<??3?ZԐ??&8 4.?/gX ??m???%?8???[?? AV?B?;?m#?2?s?ѝڨ~m??O ... ... ... ... ... ... ... ... ... ... ... ... etc etc etc ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... |
NOTE: The response here is the raw bytes of a ZIP file, so it will seem like nonsense is being returned from curl
.
Relevant endpoints:
GET /api/datasets/{dataset_id}/listFiles
GET /api/datasets/{dataset_id}/listAllFiles
GET /api/files/{file_id}/metadata
GET /api/files/{file_id}/metadata.jsonld
GET /api/files/{file_id}
Relevant endpoints:
GET /api/datasets/{dataset_id}/listFiles
GET /api/datasets/{dataset_id}/listAllFiles
To list all files within a dataset:
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/listFiles?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"size":"70561","date-created":"Tue Jul 17 15:26:54 CDT 2018","id":"5b4e510e77c8fff0a4797871","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 15:27:27 CDT 2018","id":"5b4e512f77c8fff0a4797879","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 15:54:14 CDT 2018","id":"5b4e577677c8fff0a47978a4","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 15:58:57 CDT 2018","id":"5b4e589177c8fff0a47978d7","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 15:59:23 CDT 2018","id":"5b4e58ab77c8fff0a4797900","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 15:59:52 CDT 2018","id":"5b4e58c877c8fff0a479792a","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:10:54 CDT 2018","id":"5b4e5b5e77c8fff0a4797970","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:12:24 CDT 2018","id":"5b4e5bb877c8fff0a479799a","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:14:56 CDT 2018","id":"5b4e5c5077c8fff0a47979cc","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:15:53 CDT 2018","id":"5b4e5c8977c8fff0a47979e1","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:15:57 CDT 2018","id":"5b4e5c8d77c8fff0a47979e7","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:16:16 CDT 2018","id":"5b4e5ca077c8fff0a47979ed","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:16:41 CDT 2018","id":"5b4e5cb977c8fff0a47979fa","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:16:57 CDT 2018","id":"5b4e5cc977c8fff0a4797a0b","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:17:14 CDT 2018","id":"5b4e5cda77c8fff0a4797a1c","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:35:30 CDT 2018","id":"5b4e612277c8fff0a4797a36","contentType":"image/png","filename":"244599644.png"}] |
Relevant endpoints:
GET /api/files/{file_id}/metadata
GET /api/files/{file_id}/metadata.jsonld
To list off static metadata for a file (e.g. file name, type, size, creation date):
$ curl --insecure http://localhost:9000/api/files/5b4e577677c8fff0a47978a4/metadata?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 {"size":"70561","date-created":"Tue Jul 17 15:54:14 CDT 2018","id":"5b4e577677c8fff0a47978a4","authorId":"5ad76e39693ea57ec7f8648a","content-type":"image/png","filename":"244599644.png","status":"PROCESSED","filedescription":""} |
To list off dynamic metadata for a file (e.g. extracted or community-added metadata):
$ curl --insecure http://localhost:9000/api/files/5b4e5cb977c8fff0a47979fa/metadata.jsonld?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 [{"@context":{"@vocab":"http://www.w3.org/2003/12/exif/ns"},"attached_to":{"resource_type":"cat:file","url":"http://localhost:9000/files/5b4e5cb977c8fff0a47979fa"},"created_at":"Tue Jul 17 16:16:41 CDT 2018","agent":{"@type":"cat:extractor","name":"http://141.142.60.27:9000//api/extractors/ncsa.image.metadata","extractor_id":"http://141.142.60.27:9000//api/extractors/ncsa.image.metadata"},"content":{"Border color":"srgba(223,223,223,1)","Compression":"Zip","Elapsed time":"0:01.009","Artifacts":{"verbose":true,"filename":"/tmp/tmp7ecihP.png"},"height":341,"Interlace":"None","Compose":"Over","Tainted":false,"Filesize":"70.6KB","Pixels per second":"12.58MB","Chromaticity":{"red primary":"(0.64,0.33)","green primary":"(0.3,0.6)","blue primary":"(0.15,0.06)","white point":"(0.3127,0.329)"},"Type":"TrueColorAlpha","Print size":"5.125x4.73611","Channel depth":{"blue":"8-bit","alpha":"1-bit","green":"8-bit","red":"8-bit"},"Background color":"white","Transparent color":"none","Mime type":"image/png","Format":"PNG (Portable Network Graphics)","Image statistics":{"Overall":{"skewness":2.67042,"min":"0 (0)","max":"255 (1)","standard deviation":"40.5176 (0.158893)","kurtosis":10.2121,"mean":"59.7823 (0.23444)"}},"Number pixels":"126K","width":369,"Channel statistics":{"Blue":{"skewness":1.15542,"min":"33 (0.129412)","max":"255 (1)","standard deviation":"45.9088 (0.180035)","kurtosis":0.797616,"mean":"101.427 (0.397754)"},"Alpha":{"skewness":0,"min":"255 (1)","max":"255 (1)","standard deviation":"0 (0)","kurtosis":0,"mean":"255 (1)"},"Green":{"skewness":1.33268,"min":"35 (0.137255)","max":"255 (1)","standard deviation":"46.7538 (0.183348)","kurtosis":1.12144,"mean":"82.284 (0.322682)"},"Pixels":125829,"Red":{"skewness":1.9517,"min":"0 (0)","max":"255 (1)","standard deviation":"47.6777 (0.186972)","kurtosis":3.54331,"mean":"55.418 (0.217325)"}},"Class":"DirectClass","Matte color":"grey74","Page geometry":"369x341+0+0","Geometry":"369x341+0+0","Colorspace":"sRGB","Depth":"8-bit","User time":"0.010u","Rendering intent":"Perceptual","Resolution":"72x72","Gamma":0.45455,"Image":"/tmp/tmp7ecihP.png","Properties":{"date":{"create":"2018-07-17T21:16:58+00:00","modify":"2018-07-17T21:16:58+00:00"},"png":{"bKGD":"chunk was found (see Background color, above)","IHDR":{"color-type-orig":6,"color_type":"6 (RGBA)","bit_depth":8,"width,height":"369, 341","bit-depth-orig":8,"interlace_method":"0 (Not interlaced)"},"pHYs":"x_res=72, y_res=72, units=0","text":"2 tEXt/zTXt/iTXt chunks were found","sRGB":"intent=0 (Perceptual Intent)","gAMA":"gamma=0.45455 (See Gamma, above)","cHRM":"chunk was found (see Chromaticity, above)"},"signature":"d63ba6d42ca061b2103c98d480e72d26d704eb259eda0cda3797eb26dfbfe1fd"},"Version":"ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org","Iterations":0}}] |
Relevant endpoints:
GET /api/files/{file_id}
To download a particular file:
$ curl --insecure http://localhost:9000/api/files/5b4e5cb977c8fff0a47979fa?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92 ?PNG IHDRq?߄gAMA?? ?asRGB??? cHRMz&?????u0?`:?p??Q<bKGD??????? pHYsHHF?k>?IDATx???W?\i?? ??v?=????ԥUWuU??,?i?6?????ٷ???}??݇??????ؘ??&??a7??-??U]??R?3?:Z?G?VW??uwD ?L $2??o@??????|???p?w?.t?A|&!>?t?Atppt?xt??g!?At?FG?w?A|?!??뺸.???㸸???? ?(????㸀? ??????n?q??]??q??W?5:A???At?9Ɓ??뺤Q?0?ט?'????CFz(?*\??@O:???QDA??? ... ... ... ... ... ... ... ... ... ... ... ... etc etc etc ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... |
NOTE: The response here is the raw bytes of a ZIP file, so it will seem like nonsense is being returned from curl
.