Page tree
Skip to end of metadata
Go to start of metadata

Index

  • List all content entities: GET /

Unit Repository

  • Create a unit: POST /units
  • Retrieve a unit: GET /units/{id}
  • Query units by id: GET /units/search/findById?id={id}
  • Query units by name: GET /units/search/findByName?name={name}
  • Query units by createdDate: GET /units/search/findByCreatedDate?createdDate={createdDate}
  • Query units by modifiedDate: GET /units/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query units by createdBy: GET /units/search/findByCreatedBy?createdBy={createdBy}
  • Query units by modifiedBy: GET /units/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a unit: PUT /units/{id}
  • Partially update a unit: PATCH /units/{id}
  • Delete a unit: DELETE /units/{id}

Collection Repository

  • Create a collection: POST /collections
  • Retrieve a collection: GET /collections/{id}
  • Query collections by id: GET /collections/search/findById?id={id}
  • Query collections by name: GET /collections/search/findByName?name={name}
  • Query collections by createdDate: GET /collections/search/findByCreatedDate?createdDate={createdDate}
  • Query collections by modifiedDate: GET /collections/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query collections by createdBy: GET /collections/search/findByCreatedBy?createdBy={createdBy}
  • Query collections by modifiedBy: GET /collections/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a collection: PUT /collections/{id}
  • Partially update a collection: PATCH /collections/{id}
  • Delete a collection: DELETE /collections/{id}

Item Repository

  • Create a item: POST /items
  • Retrieve a item: GET /items/{id}
  • Query items by id: GET /items/search/findById?id={id}
  • Query items by name: GET /items/search/findByName?name={name}
  • Query items by createdDate: GET /items/search/findByCreatedDate?createdDate={createdDate}
  • Query items by modifiedDate: GET /items/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query items by createdBy: GET /items/search/findByCreatedBy?createdBy={createdBy}
  • Query items by modifiedBy: GET /items/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Query items by keyword: GET /items/search/findByKeyword?keyword={keyword}
    • The keyword is case sensitive
    • The keyword applies to both item name and description
  • Update a item: PUT /items/{id}
  • Partially update a item: PATCH /items/{id}
  • Delete a item: DELETE /items/{id}

Primaryfile Repository

  • Create a primaryfile: POST /primaryfiles
  • Retrieve a primaryfile: GET /primaryfiles/{id}
  • Query primaryfiles by id: GET /primaryfiles/search/findById?id={id}
  • Query primaryfiles by name: GET /primaryfiles/search/findByName?name={name}
  • Query primaryfiles by createdDate: GET /primaryfiles/search/findByCreatedDate?createdDate={createdDate}
  • Query primaryfiles by modifiedDate: GET /primaryfiles/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query primaryfiles by createdBy: GET /primaryfiles/search/findByCreatedBy?createdBy={createdBy}
  • Query primaryfiles by modifiedBy: GET /primaryfiles/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Query primaryfiles by keyword: GET /primaryfiles/search/findByKeyword?keyword={keyword}
    • The keyword is case sensitive
    • The keyword applies to both primaryfiles name and description
  • Update a primaryfile: PUT /primaryfiles/{id}
  • Partially update a primaryfile: PATCH /primaryfiles/{id}
  • Delete a primaryfile: DELETE /primaryfiles/{id}

CollectionSupplement Repository

  • Create a collectionSupplement: POST /collectionSupplements
  • Retrieve a collectionSupplement: GET /collectionSupplements/{id}
  • Query collectionSupplements by id: GET /collectionSupplements/search/findById?id={id}
  • Query collectionSupplements by name: GET /collectionSupplements/search/findByName?name={name}
  • Query collectionSupplements by createdDate: GET /collectionSupplements/search/findByCreatedDate?createdDate={createdDate}
  • Query collectionSupplements by modifiedDate: GET /collectionSupplements/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query collectionSupplements by createdBy: GET /collectionSupplements/search/findByCreatedBy?createdBy={createdBy}
  • Query collectionSupplements by modifiedBy: GET /collectionSupplements/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a collectionSupplement: PUT /collectionSupplements/{id}
  • Partially update a collectionSupplement: PATCH /collectionSupplements/{id}
  • Delete a collectionSupplement: DELETE /collectionSupplements/{id}

ItemSupplement Repository

  • Create a itemSupplement: POST /itemSupplements
  • Retrieve a itemSupplement: GET /itemSupplements/{id}
  • Query itemSupplements by id: GET /itemSupplements/search/findById?id={id}
  • Query itemSupplements by name: GET /itemSupplements/search/findByName?name={name}
  • Query itemSupplements by createdDate: GET /itemSupplements/search/findByCreatedDate?createdDate={createdDate}
  • Query itemSupplements by modifiedDate: GET /itemSupplements/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query itemSupplements by createdBy: GET /itemSupplements/search/findByCreatedBy?createdBy={createdBy}
  • Query itemSupplements by modifiedBy: GET /itemSupplements/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a itemSupplement: PUT /itemSupplements/{id}
  • Partially update a itemSupplement: PATCH /itemSupplements/{id}
  • Delete a itemSupplement: DELETE /itemSupplements/{id}

PrimaryfileSupplement Repository

  • Create a primaryfileSupplement: POST /primaryfileSupplements
  • Retrieve a primaryfileSupplement: GET /primaryfileSupplements/{id}
  • Query primaryfileSupplements by id: GET /primaryfileSupplements/search/findById?id={id}
  • Query primaryfileSupplements by name: GET /primaryfileSupplements/search/findByName?name={name}
  • Query primaryfileSupplements by createdDate: GET /primaryfileSupplements/search/findByCreatedDate?createdDate={createdDate}
  • Query primaryfileSupplements by modifiedDate: GET /primaryfileSupplements/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query primaryfileSupplements by createdBy: GET /primaryfileSupplements/search/findByCreatedBy?createdBy={createdBy}
  • Query primaryfileSupplements by modifiedBy: GET /primaryfileSupplements/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a primaryfileSupplement: PUT /primaryfileSupplements/{id}
  • Partially update a primaryfileSupplement: PATCH /primaryfileSupplements/{id}
  • Delete a primaryfileSupplement: DELETE /primaryfileSupplements/{id}

Bundle Repository

  • Create a bundle: POST /bundles
  • Retrieve a bundle: GET /bundles/{id}
  • Query bundles by id: GET /bundles/search/findById?id={id}
  • Query bundles by name: GET /bundles/search/findByName?name={name}
  • Query bundles by createdDate: GET /bundles/search/findByCreatedDate?createdDate={createdDate}
  • Query bundles by modifiedDate: GET /bundles/search/findByModifiedDate?modifiedDate={modifiedDate}
  • Query bundles by createdBy: GET /bundles/search/findByCreatedBy?createdBy={createdBy}
  • Query bundles by modifiedBy: GET /bundles/search/findByModifiedBy?modifiedBy={modifiedBy}
  • Update a bundle: PUT /bundles/{id}
  • Partially update a bundle: PATCH /bundles/{id}
  • Delete a bundle: DELETE /bundles/{id}


Note:

  • For all POST/PUT/PATCH requests for above entities, the request body needs to be populated as JSON string for the objected to be created/updated. For GET/DELETE requests, no parameter or body is needed.
  • One can use the HAL Browser itself, or Postman, or curl command to send these requests.

Content Ingest (File Upload)

  • Upload a primaryfile: POST   /rest/primaryfiles/{id}/upload
  • Upload a collectionSupplement: POST   /rest/collections/supplements/{id}/upload
  • Upload a itemSupplement: POST   /rest/items/supplements/{id}/upload
  • Upload a primaryfileSupplement: POST   /rest/primaryfiles/supplements/{id}/upload

Note:

  • One needs to create the asset (primaryfile or 3 levels of supplements) first (POST request), then upload a file for that asset (another POST request).
  • One needs to create the parent entity to which the asset shall be linked to as well, as well as all the parent entities all the way up the hierarchy, and this should be better done even before creating the asset. For ex, if the asset is a primaryfileSupplement, then the following whole chain of entities shall be created first before upload: unit - collection - item - primaryfile - primaryfileSupplement.
  • File upload can be done in Postman as follows:
  1. In Header, put ContentType as multipart-formdata
  2. In Body, choose form-data, in KEY put file, and choose File as the type; in VALUE, click the Choose File button to choose a file
  3. click Send

Bundle Operation

  • Find all named bundles, i.e. bundles with non-empty name and non-empty primary files: GET   /rest/bundles/search/findAllNamed
  • Find the bundle with the given name created by the current user: GET   /rest/bundles/search/findNamedByCurrentUser?name={name}
  • Add a primaryfile to a bundle: POST  /rest/bundles/{bundleId}/addPrimaryfile?primaryfileId={primaryfileId}
  • Add multiple primaryfile to a bundle: POST  /rest/bundles/{bundleId}/addPrimaryfiles?primaryfileIds={primaryfileId1, primaryfileId1, ...}
  • Delete a primaryfile from a bundle: DELETE  /rest/bundles/{bundleId}/deletePrimaryfile?primaryfileId={primaryfileId}
  • Delete multiple primaryfile to a bundle: POST  /rest/bundles/{bundleId}/deletePrimaryfiles?primaryfileIds={primaryfileId1, primaryfileId1, ...}
  • Update the given bundle with the given description and set of primary files.  POST  /rest/bundles/{bundleId}/update?description={description}
  • Create a new bundle with the given name and prifmaryfiles. POST  /rest/bundles/create?name={name}&description={description}&primaryfileIds={primaryfileId1, primaryfileId1, ...}

Note: No request parameter/body is needed for bundle-item operations.

Link A Child Entity to Its Parent Entity

Note:

  • Before linking child-parent entities, both parent and child shall be created first, then adding the association as follows. Refer to the AMP data model for all relationships between data entities.
  • In all 1:M relationships in AMP, the child entity is the owner of the relationship, thus all updates of the relationship need to happen from the child side, by sending a PUT request, with URI being the location of the parent property in the child, ContentType being text/uri-list, and body being the parent's href URI.
  • Above said, HAL browser shows a link of the children in the parent's properties, and does provide a POST request endpoint for it, but it's unclear what should be populated in the JSON string to be sent. Further research is needed to answer this question.
  • Postman or curl can be used for such requests.

Using Collection-Item as an example, below are the steps to add an item (child) to a collection (parent) via Postman:

  1. Create the collection, for ex, location being http://localhost:8080/collections/1
  2. Create the item, for ex, location is http://localhost:8080/items/2
  3. Choose PUT as request type, http://localhost:8080/items/2/collection as the URL
  4. In Header, put ContentType as text/uri-list
  5. In Body, choose raw, put http://localhost:8080/collections/1 as the content
  6. Click Send
  7. You will get a 204 (no content) response.
  8. You can send a GET request to either http://localhost:8080/collections/1 or http://localhost:8080/items/2 and the links section shall show the linked items or collection respectively.

Create Dropbox Subdirectories for Existing Collections

  • Create doprbox subdirectories for all existing collections (assume their parent units are already created and linked):
    • REST API: POST   rest/dropbox/create
    • This API only affects collections that don't have dropbox subdirectory yet. Collections with subdirectories already created stay as they are and will not be impacted.
    • We currently don't have API for creating subdirectory for a particular collection, as it can be easily done manually on the server. An endpoint for this can be added if desired.

Media 

  • Serve the media file of the given primaryfile by redirecting the request to the AMPPD UI Apache server : GET rest/primaryfiles/{id}/media
  • Serve the output file of the given workflowResult by redirecting the request to the AMPPD UI Apache server.: GET rest/workflow-results/{id}/output
  • serve the primary file by Collection or Item or File name:  GET rest/primaryfiles/search/findByItemOrFileName 

Account Operations

  • Create authentication token for valid username and password: POST  /rest/account/authenticate

         Ex:      POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/authenticate

                    Body JSON:        {"username": "username", "password": "password"}

                    Output:              {"token": "tokenString"}

  • Validate authentication token: POST  /rest/account/validate 

          Ex:      POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/validate

                     Body JSON:     No Need

                     Authorization Bearer token:  Need to send above genereated Token 

                     Output:             Success

  • Register user Information : POST   /rest/account/register

           Ex:      POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/register

                       Body JSON:     {"username":"username","password":"password","email":"email","firstName":"firstName","lastName":"lastName"}

                      Authorization Bearer token:  Need to send above generated Token 

                       Output:            {"success": true,"errors": [],"emailid": null}

  • Send forget password link to user email: POST  /rest/account/forgot-password

            Ex:   POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/forgot-password

                       Body JSON:     {"emailid": "emailId"}

                      Authorization Bearer token:  Need to send above generated Token 

                       Output:            {"success": true,"errors": [],"emailid": null}

  • Reset password  operation : POST   /rest/account/reset-password

             Ex:   POST Request: http://potassium.dlib.indiana.edu:8200/rest/account/reset-password

                       Body JSON:    {"emailid": "emailId","password": "password","token": "token"}

                       Output:            {"success": true,"errors": [],"emailid": null}

  • Registered User approve process  by admin   : POST     /rest/account/approve

               Ex:   POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/approve

                       Body JSON:    {"userId": "userId"}

                        Authorization Bearer token:  Need to send above generated Token 

                        Output:            {"success": true,"errors": [],"emailid": null}   

  • Registered user  reject process by admin: POST /rest/account/reject

               Ex:   POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/reject

                       Body JSON:    {"userId": "userId"}

                        Authorization Bearer token:  Need to send above generated Token 

                        Output:            {"success": true,"errors": [],"emailid": null}   

  • Approved user Activation  process: POST  /rest/account/activate

              Ex:   POST Request:  http://potassium.dlib.indiana.edu:8200/rest/account/activate

                       Body JSON:    {"token": "token"}

                       Output:            {"success": true,"errors": [],"emailid": null} 

  • Fetch  Email of  Reset password      :POST /rest/account/reset-password-getEmail

              Ex:   POST Request: http://potassium.dlib.indiana.edu:8200/rest/account/reset-password-getEmail

                       Body JSON:    {"token": "token"}

                       Output:            {"success": true,"errors": [],"emailid": null} 

  • User details :GET  /rest/account/{Id}

             Ex:   GET Request: http://potassium.dlib.indiana.edu:8200/rest/account/8347

                      Params:  No need

                      Output:  {"id": id"username": "username""email": "email""password": "encoded Password""firstName": "firstname""lastName": "lastName""status": "status""role": null }





  


  • No labels