Skip to content

Commit

Permalink
pkp/pkp-lib#10412 Add API endpoints for emailLogEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Sep 27, 2024
1 parent 22ead1e commit 5a1f098
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 1 deletion.
19 changes: 19 additions & 0 deletions api/v1/emails/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @defgroup api_v1_emails Email API requests
*/

/**
* @file api/v1/emails/index.php
*
* Copyright (c) 2023 Simon Fraser University
* Copyright (c) 2023 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_emails
*
* @brief Handle requests for emails API functions.
*
*/
return new \PKP\handler\APIHandler(new \PKP\API\v1\emails\PKPEmailController());
105 changes: 104 additions & 1 deletion docs/dev/swagger-source.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"Stats / Sushi",
"Vocabs",
"Temporary Files",
"Backend"
"Backend",
"Emails"
]
}
],
Expand Down Expand Up @@ -202,6 +203,10 @@
{
"name": "Backend",
"description": "Private endpoints for OJS's UI. These endpoints will be less stable between versions. We discourage their use in third-party plugins or applications."
},
{
"name": "Emails",
"description": "Endpoints used to retrieve user emails."
}
],
"definitions": {
Expand Down Expand Up @@ -283,6 +288,7 @@
}
},
"EmailTemplate": "emailTemplate",
"Email": "emailLog",
"Galley": "galley",
"Institution": "institution",
"InvalidParametersResponse": {
Expand Down Expand Up @@ -4900,6 +4906,103 @@
}
}
},
"/emails/authorEmails": {
"get": {
"tags": [
"Emails"
],
"summary": "Gets an Author's email entry logs.",
"parameters": [
{
"name": "submissionId",
"description": "Filter results to emails associated with a specific submissionId.",
"in": "query",
"required": false,
"type": "integer"
},
{
"name": "eventType",
"description": "Filter results by an event type",
"in": "query",
"required": false,
"type": "integer"
}
],
"responses": {
"200": {
"x-summary": "Success",
"description": "List of emails.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/EmailSummary"
}
}
},
"403": {
"x-summary": "Request Unauthorized",
"description": "You do not have permission to view emails.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"x-summary": "Request Not Found",
"description": "No matching resource for a provided query param. Example: no submission found matching the provided `submissionId` query param.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"400": {
"x-summary": "Request Invalid",
"description": "Your request was not valid. One or more of the request query params are invalid. The error message will contain details about the invalid query param.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/emails/{emailId}": {
"get": {
"tags": [
"Emails"
],
"summary": "Get an email entry log by ID",
"parameters": [
{
"name": "emailId",
"description": "Email ID",
"in": "path",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"x-summary": "Success",
"description": "The email entry log details.",
"schema": {
"$ref": "#/definitions/EmailSummary"
}
},
"403": {
"x-summary": "Request Unauthorized",
"description": "You do not have permission to access this email.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"x-summary": "Request Not Found",
"description": "The email could not be found.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/institutions": {
"get": {
"tags": [
Expand Down

0 comments on commit 5a1f098

Please sign in to comment.