Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Authentication via REST API

Relevant endpoints:

  • GET /authenticate/{provider}
  • GET /logout

Log In

Relevant endpoint:

  • GET /authenticate/{provider}

Accepted provider values:

  • userpass

Authenticating

Methods:

  • Basic Auth
  • API keys
  • Cookie (Manual)

Basic Auth

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:

Code Block
languagebash
$ curl --insecure http://XPOST '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.

Log Out

Relevant endpoint:

...

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.

User API Keys (Recommended)

For simplicity, you can manage your User API keys in the Clowder UI:

  1. Log into Clowder
  2. At the top-right expand the dropdown containing your user profile picture
  3. Select "View Profile" from the dropdown

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:

Image Added

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.

Creating a Key via REST API

Relevant endpoints:

  • POST /api/users/keys?name={key-name}

To create a new API key with the given name:

Code Block
languagebash
$ 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:

Code Block
languagebash
$ 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"}}]

Retrieving Keys via REST API

Relevant endpoints:

  • GET /api/users/keys
  • GET /api/users/keys/{key-name}

To retrieve a list of all existing API keys for this user:

Code Block
languagebash
$ 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.

User API Keys

For simplicity, you can manage your User API keys in the Clowder UI:

  1. Log into Clowder
  2. At the top-right expand the dropdown containing your user profile picture
  3. Select "View Profile" from the dropdown

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:

Image Removed

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.

Creating a Key via REST API

Relevant endpoints:

  • POST /api/users/keys?name={key-name}

To create a new API key with the given name for the currently-logged-in user:

Code Block
languagebash
$ curl --insecure 'http://localhost:9000/api/users/keys?name=testkey' -XPOST --cookie 'id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13' -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> POST /api/users/keys?name=testkey HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 63
< 
* Connection #0 to host localhost left intact
{"name":"testkey","key":"839785b9-5e23-4a1b-92f7-259294a58aed"}

You can then attach this key as a query string parameter for all subsequent API requests, instead of needing to reauthenticate manually and attaching another cookie.

NOTE: One exception is that you cannot call the /api/users/keys endpoints using an API key, as this would cause too much security risk/confusion in case an API key were to be compromised.

For example, using a User API key to call the /api/datasets endpoint would look like this:

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:

Code Block
languagebash
$ 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"}}

Deleting Keys via REST API

Relevant endpoints:

  • DELETE /api/users/keys/{key-name}

To delete an existing API key:

Code Block
languagebash
$ curl --insecure 'http://localhost:9000/api/users/keys/testkey?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92'

Manual Cookie Auth (Not recommended)

Relevant endpoint:

  • GET /authenticate/{provider}

Accepted provider values:

  • userpass


Code Block
languagebash
$ 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:

Code Block
languagebash
$ 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.

Spaces

Relevant endpoints:

  • GET /api/spaces
  • GET /api/spaces/{space_id}/datasets

To list all spaces that you can view:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/spaces?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92
[{"id":"5b6a0cf877c86409e0925d85","name":"a space
Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets?key=839785b9-5e23-4a1b-92f7-259294a58aed -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets?key=839785b9-5e23-4a1b-92f7-259294a58aed HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 411
< 
* Connection #0 to host localhost left intact
[{"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue JulAug 1707 1516:2619:4552 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]},{"id":"5ad7b5b377c8a52d73b2ac5f5b21310077c8829cd73f8899","name":"test_dataset","description":"","created":"Wed AprJun 1813 1609:1658:3508 CDT 2018"},{"id":"5b0724b277c85c0c70e371d8","name":"newspace","thumbnaildescription":"None","authorIdcreated":"5ad76e39693ea57ec7f8648a","spaces":["5ad7b4b777c8a52d73b2ac48"]Thu May 24 15:46:42 CDT 2018"},{"id":"5ad7b4b777c8a52d73b2ac48","name":"test","description":"","created":"Wed Apr 18 16:12:23 CDT 2018"}]

Retrieving Keys via REST API

Relevant endpoints:

  • GET /api/users/keys
  • GET /api/users/keys/{key-name}

To retrieve a list of all existing API keys for this user:

To list all datasets within a space:

Code Block
Code Block
languagebash
$ curl --insecure http://localhost:9000/api/spaces/users/keys --cookie 'id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13' -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/users/keys HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 137
< 
* Connection #0 to host localhost left intact
[{"name":"testkey","key":"22da6ca7-1c66-4612-bc4d-368f92ecf9bf","identityId":{"userId":"lambert8@illinois.edu","providerId":"userpass"}}]

To retrieve a specific API key by name:

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"]}]

Datasets

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

Listing Datasets

Relevant endpoints:

  • GET /api/datasets
  • GET /api/datasets/canEdit

To list all datasets that you can view:

Code Block
languagebash
$ 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:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/users/keys/testkey --cookie 'id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13' -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/users/keys/testkey HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 135
< 
* Connection #0 to host localhost left intact
{"name":"testkey","key":"22da6ca7-1c66-4612-bc4d-368f92ecf9bf","identityId":{"userId":"lambert8@illinois.edu","providerId":"userpass"}}

Deleting Keys via REST API

Relevant endpoints:

  • DELETE /api/users/keys/{key-name}
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"]}]

Querying Dataset Metadata

Relevant endpoints:

  • GET /api/datasets/{dataset_id}
  • GET /api/datasets/{dataset_id}/metadata

To retrieve a single datasetTo delete an existing API key:

Code Block
languagebash
$ curl --insecure 'http://localhost:9000/api/users/keys/testkey' -XDELETE --cookie 'id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13' -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> DELETE /api/users/keys/testkey HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=2859bdc9050ec48ea779db10bc1f54dda37e75ebc13d1c65bad0f90810159b5047df7b67dd7802b64ad7eb1dff9b4355fc67a26a9a009fffcb9de1aa5b31b7a1739553da9cfcd0d060fb11cdf96a1fadf94fd3f49afb50a4b5df6b7a9a460cbbce37d3aa012bca3b77c921f6038dd2cc618ac4f0958e33da39d5b5948c07ab13
> 
< HTTP/1.1 204 No Content
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Credentials: true
< Content-Length: 0
< 
* Connection #0 to host localhost left intact

Spaces

Relevant endpoints:

  • GET /api/spaces
  • GET /api/spaces/{space_id}/datasets

To list all spaces that you can view:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/spaces -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/spaces HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 432
< 
* Connection #0 to host localhost left intact
[{"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:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/spaces/5b0724b277c85c0c70e371d8/datasets -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/spaces/5b0724b277c85c0c70e371d8/datasets HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 202
< 
* Connection #0 to host localhost left intact
[{"id":"5b4e510577c8fff0a479786c","name":"asdf","description":"","created":"Tue Jul 17 15:26:45 CDT 2018","thumbnail":"None","authorId":"5ad76e39693ea57ec7f8648a","spaces":["5b0724b277c85c0c70e371d8"]}]

Datasets

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

Listing Datasets

Relevant endpoints:

  • GET /api/datasets
  • GET /api/datasets/canEdit

To list all datasets that you can view:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets --cookie 'id=3656a7a78433b52522cc4cd3d1b42579e76ee46c688faa5e5c4259623dfe83531008669ad7769e600ba9d1d94b2d590710d9c9cc98f6b79728ec2cd6e043f97c6e69d5d21e0ba6f7ff0528fa310bf1f2d5002348e3c2b9957d47905ac030de57b2bd9deffd450b32ee452d4c87543f65476be709ccebb7be3b0773e8488bb496' -vvv
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=3656a7a78433b52522cc4cd3d1b42579e76ee46c688faa5e5c4259623dfe83531008669ad7769e600ba9d1d94b2d590710d9c9cc98f6b79728ec2cd6e043f97c6e69d5d21e0ba6f7ff0528fa310bf1f2d5002348e3c2b9957d47905ac030de57b2bd9deffd450b32ee452d4c87543f65476be709ccebb7be3b0773e8488bb496
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 411
< 
* Connection #0 to host localhost left intact
[{"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:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/canEdit -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets/canEdit HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 411
< 
* Connection #0 to host localhost left intact
[{"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"]}]

Querying Dataset Metadata

Relevant endpoints:

  • GET /api/datasets/{dataset_id}
  • GET /api/datasets/{dataset_id}/metadata

To retrieve a single dataset:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets/5b4e510577c8fff0a479786c HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 200
< 
* Connection #0 to host localhost left intact
{"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:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/metadata -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets/5b4e510577c8fff0a479786c/metadata HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 6331
< 
[{"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"}}]

Download a Dataset

Relevant endpoints:

  • GET /api/datasets/{dataset_id}/download

To download an entire dataset as a .zip file:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/download -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f' --silent
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets/5b4e510577c8fff0a479786c/download HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Transfer-Encoding: chunked
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/zip
< Content-Disposition: attachment; filename*=UTF-8''asdf.zip
< 
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.

Files

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}/technicalmetadatajson
  • GET /api/files/{file_id}

Listing Files

Relevant endpoints:

  • GET /api/datasets/{dataset_id}/listFiles
  • GET /api/datasets/{dataset_id}/listAllFiles

To list all files within a dataset:

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:

Code Block
languagebash
$ 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"}}]

Download a Dataset

Relevant endpoints:

  • GET /api/datasets/{dataset_id}/download

To download an entire dataset as a .zip file:

Code Block
languagebash
$ 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.

Files

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}/technicalmetadatajson
  • GET /api/files/{file_id}

Listing Files

Relevant endpoints:

  • GET /api/datasets/{dataset_id}/listFiles
  • GET /api/datasets/{dataset_id}/listAllFiles

To list all files within a dataset:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/listFiles?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92
[
Code Block
languagebash
$ curl --insecure http://localhost:9000/api/datasets/5b4e510577c8fff0a479786c/listFiles -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/datasets/5b4e510577c8fff0a479786c/listFiles HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 2369
< 
* Connection #0 to host localhost left intact
[{"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 1615:1026:54 CDT 2018","id":"5b4e5b5e77c8fff0a47979705b4e510e77c8fff0a4797871","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 1615:1227:2427 CDT 2018","id":"5b4e5bb877c8fff0a479799a5b4e512f77c8fff0a4797879","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 1615:54:14:56 CDT 2018","id":"5b4e5c5077c8fff0a47979cc5b4e577677c8fff0a47978a4","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 1615:1558:5357 CDT 2018","id":"5b4e5c8977c8fff0a47979e15b4e589177c8fff0a47978d7","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 1615:1559:5723 CDT 2018","id":"5b4e5c8d77c8fff0a47979e75b4e58ab77c8fff0a4797900","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 1615:1659:1652 CDT 2018","id":"5b4e5ca077c8fff0a47979ed5b4e58c877c8fff0a479792a","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:1610:4154 CDT 2018","id":"5b4e5cb977c8fff0a47979fa5b4e5b5e77c8fff0a4797970","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:1612:5724 CDT 2018","id":"5b4e5cc977c8fff0a4797a0b5b4e5bb877c8fff0a479799a","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:1714:1456 CDT 2018","id":"5b4e5cda77c8fff0a4797a1c5b4e5c5077c8fff0a47979cc","contentType":"image/png","filename":"244599644.png"},{"size":"70561","date-created":"Tue Jul 17 16:3515:3053 CDT 2018","id":"5b4e612277c8fff0a4797a365b4e5c8977c8fff0a47979e1","contentType":"image/png","filename":"244599644.png"}]

Querying File Metadata

Relevant endpoints:

  • GET /api/files/{file_id}/metadata
  • GET /api/files/{file_id}/technicalmetadatajson

To list off static metadata for a file (e.g. file name, type, size, creation date):

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/files/5b4e577677c8fff0a47978a4/metadata -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/files/5b4e577677c8fff0a47978a4/metadata HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 228
< 
* Connection #0 to host localhost left intact
,{"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 1516:5417:14 CDT 2018","id":"5b4e577677c8fff0a47978a4","authorId":"5ad76e39693ea57ec7f8648a5b4e5cda77c8fff0a4797a1c","content-typecontentType":"image/png","filename":"244599644.png"},{"statussize":"PROCESSED70561","filedescription":""}

To list off dynamic metadata for a file (e.g. extracted or community-added metadata):

date-created":"Tue Jul 17 16:35:30 CDT 2018","id":"5b4e612277c8fff0a4797a36","contentType":"image/png","filename":"244599644.png"}]

Querying File Metadata

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):

Code Block
languagebash
$ 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):

Code Block
languagebash
$ 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
Code Block
languagebash
$ curl --insecure http://localhost:9000/api/files/5b4e5cb977c8fff0a47979fa/technicalmetadatajson -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/files/5b4e5cb977c8fff0a47979fa/technicalmetadatajson HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: application/json; charset=utf-8
< Content-Length: 2417
< 
* Connection #0 to host localhost left intact
[{"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":"040.5176 (0.158893)","kurtosis":010.2121,"mean":"25559.7823 (10.23444)"}},"GreenNumber pixels":"126K","width":369,"Channel statistics":{"Blue":{"skewness":1.3326815542,"min":"3533 (0.137255129412)","max":"255 (1)","standard deviation":"4645.75389088 (0.183348180035)","kurtosis":10.12144797616,"mean":"82101.284427 (0.322682397754)"},"PixelsAlpha":125829,"Red":{"skewness":1.95170,"min":"0255 (01)","max":"255 (1)","standard deviation":"47.67770 (0.186972)","kurtosis":3.543310,"mean":"55.418255 (0.2173251)"}},"ClassGreen":{"DirectClassskewness":1.33268,"Matte colormin":"grey7435 (0.137255)","Page geometrymax":"369x341+0+0255 (1)","Geometrystandard deviation":"369x341+0+046.7538 (0.183348)","Colorspacekurtosis":"sRGB"1.12144,"Depthmean":"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)","cHRM82.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 Chromaticitycolor, above)"},"signatureIHDR":{"d63ba6d42ca061b2103c98d480e72d26d704eb259eda0cda3797eb26dfbfe1fd"},"Versioncolor-type-orig":6,"color_type":"ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org (RGBA)","Iterations":0}]

Download a File

Relevant endpoints:

  • GET /api/files/{file_id}

To download a particular file:

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}}]

Download a File

Relevant endpoints:

  • GET /api/files/{file_id}

To download a particular file:

Code Block
languagebash
$ curl --insecure http://localhost:9000/api/files/5b4e5cb977c8fff0a47979fa?key=257be5f9-e685-4dec-8bed-c4c9dccb0b92
Code Block
languagebash
$ curl --insecure http://localhost:9000/api/files/5b4e5cb977c8fff0a47979fa -vvv --cookie 'id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> GET /api/files/5b4e5cb977c8fff0a47979fa HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Cookie: id=9fc6734ca6f963af97327d668ac57455b06080277b38c50109955df81fd5e6159a2143d221381a11d99e4c727e00c72f59b65dae99999a956a63690ad53261bcd4c5515e28a0efe2d9a449397cf6f80226989db49ee8ddf6fba1e8fa4d1497bac4dbddfc00274e128bc5b224901fdaf9f31bff020b684a7bbceaf3197921a77f
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: 
< Transfer-Encoding: chunked
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Type: image/png
< Content-Disposition: attachment; filename*=UTF-8''244599644.png
< 
?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 ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

...