Versions Compared

Key

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

...

Eventually, we hope to schedule this script to run once per week to ensure site content is reset on a regular schedule.


Using the demo REST API

From a development User Interface

Both the demo.dspace.org and sandbox.dspace.org REST APIs are publicly accessible and will allow connections from http://localhost:4000/.  This allows developers to run the User Interface locally on port 4000 and use either demo REST API as a backend.  Here's the configurations you'd need in your User Interface's config.yml :

Code Block
# To use the demo.dspace.org REST API
rest:
  ssl: true
  host: demo.dspace.org
  port: 443
  nameSpace: /server

# To use the sandbox.dspace.org REST API
rest:
  ssl: true
  host: sandbox.dspace.org
  port: 443
  nameSpace: /server


From command-line or other tools

Both the demo.dspace.org and sandbox.dspace.org REST API can also be used via command-line tools or other REST tools/libraries.

Make sure to pass in a 'User-Agent'!

Because both sites run behind Amazon CloudFront, you MUST pass a valid User-Agent HTTP header into all requests.  Otherwise, CloudFront may block the request with a 403 response.

For example: 

Code Block
# No 'user-agent'! This will return a 403 Forbidden from Amazon CloudFront
curl -v 'https://demo.dspace.org/server/api'

# This command will work properly. It sets the user-agent to that of a Firefox browser
curl -v 'https://demo.dspace.org/server/api/' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0'