Skip to content
Brandon Spears edited this page Jun 20, 2019 · 1 revision

Scholar API

Current Version: 1.0

All Calls

Method URL (https://scholar.uc.edu) Description
GET /api/users/email(.json) Return user.
PATCH /api/users/email(.json) Update user.
POST /api/users Create user.
GET /api/concern/work_type/id(.json) Return a work.
PATCH /api/concern/work_type/id(.json) Update a work.
POST /api/concern/work_type Create a work.
GET /api/collections/id(.json) Return a collection.
PATCH /api/collections/id(.json) Update a collection.
POST /api/collections Create a collection.

If you need more information about these calls, please see their respective page

The current valid work_types are: etds, articles, documents, datasets, images, media, student_works, generic_works. The id field is only if you have an existing id, you can't make your own. The email field in the URL must replace the "." with "-dot-". Do not do this when it is passed as a parameter via JSON. For example example@mail-dot-com.

Request

A standard request using curl looks like curl -X GET https://scholar.uc.edu/api/concern/WORK_TYPE/WORK_ID -H 'API-KEY: UNIQUE_API_KEY, where the WORK_TYPE, WORK_ID, and UNIQUE_API_KEY are specific to your needs.

Our application accepts both multipart/form-data and application/json content types.

multipart/form-data:

curl -X POST \
  http://scholar.uc.edu/api/concern/WORK_TYPE \
  -H 'api-key: UNIQUE_API_KEY' \
  -H 'Content-Type: multipart/form-data' \
  -F title=Title \
  -F email=test@mail.com \
  -F first_name=FName \
  -F last_name=LName \
  -F college=Libraries \
  -F 'department=Program or Department' \
  -F creator=Creator \
  -F description=Description \
  -F 'license=http://rightsstatements.org/vocab/InC/1.0/'

application/json:

curl -X POST \
  http://scholar.uc.edu/api/concern/WORK_TYPE \
  -H 'Content-Type: application/json' \
  -H 'api-key: UNIQUE_API_KEY' \
  -d '{
    "title": "Title",
    "email": "test@mail.com",
    "first_name": "FName",
    "last_name": "LName",
    "college": "Libraries",
    "department": "Program or Department",
    "creator": "Creator",
    "description": "Description",
    "license": "http://rightsstatements.org/vocab/InC/1.0/"
}'

Multi-Valued Fields

Multi-valued fields are fields that allow for multiple values in them. When using the website, there is a button that allows you to add another field. In the API, all you have to do is put a | between them. For example "related_url": "www.google.com|www.bing.com".

When developing the API, we used an application called Postman. It has a variety of useful features, and a free version that you can use. If you are not comfortable with curl, we highly recommend using Postman.