Service Endpoints¶
Service Endpoints¶
Service Collection¶
-
GET
/api_v1/services/
¶ Retrieve details of all
Services
.Example request:
GET /api_v1/services/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "name": "eaasi", "readable_name": "EaaSI", "links": [ { "name": "Detail", "link": "https://presqt-prod.crc.nd.edu/api_v1/services/eaasi/", "method": "GET" } ] } ]
- Status Codes
200 OK –
Services successfully retrieved
Service Details¶
-
GET
/api_v1/services/(str: service_name)/
¶ Retrieve details of a single
Service
.Example request:
GET /api_v1/services/eaasi/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "name": "eaasi", "readable_name": "EaaSI", "links": [ { "name": "Proposals", "link": "https://presqt-prod.crc.nd.edu/api_v1/services/eaasi/proposals/", "method": "POST" } ] }
- Status Codes
200 OK –
Service
successfully retrieved404 Not Found – Invalid
Service
name
Keyword Enhancement¶
Get Keyword Enhancements From A List Of Keywords¶
-
GET
/api_v1/services/presqt/keyword_enhancement/
¶ Take a list of keywords and run them through the keyword enhancement service. The returned payload will contain both the new keywords added and the final full list of keywords.
There are separate endpoints for keyword enhancements through Targets. See the API Endpoint documentation to learn more.
Example request:
POST /api_v1/services/presqt/keyword_enhancement/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json Example body json: { "keywords": ["cat", "water"] }
Example response:
HTTP/1.1 202 Accepted Content-Type: application/json { "keywords_added": [ "feline", "aqua", "dihydrogen oxide", "DISORDERED SOLVENT", "EGG", "Electrostatic Gravity Gradiometer", "oxidane", "OXYGEN ATOM", "Wasser", "Water" ], "final_keywords": [ "feline", "aqua", "dihydrogen oxide", "DISORDERED SOLVENT", "EGG", "eggs", "Electrostatic Gravity Gradiometer", "oxidane", "OXYGEN ATOM", "Wasser", "water", "Water" ] }
- JSON Parameters
keywords (array) – An array of the
keywords
to upload
- Status Codes
202 Accepted –
Keywords successfully uploaded
EaaSI Endpoints¶
Submit EaaSI Proposal¶
-
POST
/api_v1/services/eaasi/proposals/
¶ Send a file from a PresQT server to start a
proposal task
on an EaaSI server.Example request:
POST /api_v1/services/eaasi/proposals/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json Example body json: { "ticket_number":"39e56297-04cc-440a-b73e-9788b220f12b" }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": "19", "message": "Proposal task was submitted." "proposal_link": "https://presqt-prod.crc.nd.edu/api_v1/services/eaasi/1/" }
- Status Codes
200 OK – Proposal successfully started.
400 Bad Request – ‘presqt-source-token’ missing in request headers
400 Bad Request – A download does not exist for this user on the server.
404 Not Found – Invalid ticket number
404 Not Found – A resource_download does not exist for this user on the server.
Get EaaSI Proposal¶
-
GET
/api_v1/services/eaasi/proposals/(str: proposal_id)/
¶ Check on the state of the EaaSI Proposal Task on the EaaSI server.
Example request:
GET /api_v1/services/eaasi/proposals/12/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json
Example response if the proposal task is not finished:
HTTP/1.1 202 Accepted Content-Type: application/json { "message": "Proposal task is still in progress." }
Example response if the proposal task is finished successfully:
HTTP/1.1 200 OK Content-Type: application/json { "image_url": "https://eaasi-portal.emulation.cloud:443/blobstore/api/v1/blobs/imagebuilder-outputs/2ca330d6-23f7-4f0a-943a-e3984b29642c?access_token=default", "image_type": "cdrom", "environments": [], "suggested": {} }
- Status Codes
200 OK –
Proposal Task
has finished successfully202 Accepted –
Proposal Task
is being processed on the EaaSI server404 Not Found – Invalid
Proposal ID
EaaSI Download¶
-
GET
/api_v1/services/eaasi/(str: ticket_number)/?eaasi_token=(str: eaasi_token)
¶ EaaSI specific download endpoint that exposes a resource on a PresQT server to download.
Example request:
GET /api_v1/services/eeasi/download/39e56297-04cc-440a-b73e/?eaasi=E9luKQU9Ywe5j HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/zip Payload is ZIP file
- Status Codes
200 OK – File successfully retrieved.
400 Bad Request –
eaasi_token
not found as query parameter.401 Unauthorized –
eaasi_token
does not match the ‘eaasi_token’ for this server process.404 Not Found – File unavailable.
404 Not Found – Invalid ticket number.
404 Not Found – A resource_download does not exist for this user on the server.
FAIRshake Endpoints¶
Get FAIRshake Rubrics¶
-
GET
/api_v1/services/fairshake/rubric/{str: rubric_id}/
¶ Get a list of merics from FAIRshake that are associated with the rubric id.
Example request:
GET /api_v1/services/fairshake/rubric/9/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "metrics": { "30": "The structure of the repository permits efficient discovery of data and metadata by end users.", "31": "The repository uses a standardized protocol to permit access by users.", "32": "The repository provides contact information for staff to enable users with questions or suggestions to interact with repository experts.", "33": "Tools that can be used to analyze each dataset are listed on the corresponding dataset pages.", "34": "The repository maintains licenses to manage data access and use.", "35": "The repository hosts data and metadata according to a set of defined criteria to ensure that the resources provided are consistent with the intent of the repository.", "36": "The repository provides documentation for each resource to permit its complete and accurate citation.", "37": "A description of the methods used to acquire the data is provided.", "38": "Version information is provided for each resource, where available." }, "answer_options": { "0.0": "no", "0.25": "nobut", "0.5": "maybe", "0.75": "yesbut", "1.0": "yes" } }
- Status Codes
200 OK – Rubric returned successfully
400 Bad Request – ‘egg’ is not a valid rubric id. Choices are: [‘7’, ‘8’, ‘9’]
POST FAIRshake Assessment¶
-
POST
/api_v1/services/fairshake/rubric/{str: rubric_id}/
¶ Submit a FAIRshake Assessment request for the given rubric.
Example request:
POST /api_v1/services/fairshake/rubric/9/ HTTP/1.1 Host: presqt-prod.crc.nd.edu Accept: application/json Example body json: { "project_url": "https://github.com/ndlib/presqt", "project_title": "presqt", "rubric_answers": { "30": "0.0", "31": "0.5", "32": "0.0", "33": "1.0", "34": "1.0", "35": "1.0", "36": "0.5", "37": "0.0", "38": "0.0" } }
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "digital_object_id": 166055, "rubric_responses": [ { "metric": "The structure of the repository permits efficient discovery of data and metadata by end users.", "score": "0.0", "score_explanation": "no" }... ] }
- Status Codes
200 OK – Assessment completed successfully.
400 Bad Request – ‘eggs’ is not a valid rubric id. Options are: [‘7’, ‘8’, ‘9’]
400 Bad Request – ‘project_url’ missing in POST body.
400 Bad Request – ‘project_title’ missing in POST body.
400 Bad Request – ‘rubric_answers’ missing in POST body.
400 Bad Request – ‘rubric_answers’ must be an object with the metric id’s as the keys and answer values as the values.
400 Bad Request – Missing response for metric ‘30’. Required metrics are: [‘30’, ‘31’, ‘32’]
400 Bad Request – ‘egg’ is not a valid answer. Options are: [‘0.0’, ‘0.25’, ‘0.5’, ‘0.75’, ‘1.0’]
400 Bad Request – ‘egg’ is not a valid metric. Required metrics are: [‘30’, ‘31’, ‘32’]