From 69eb5048f3702bdb09b8471f823e60fb2f5f368e Mon Sep 17 00:00:00 2001 From: mohamed eskander Date: Wed, 3 Jan 2024 13:35:10 +0200 Subject: [PATCH 1/3] added a new contract for ldnmessages endpoints --- ldnmessages.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 ldnmessages.md diff --git a/ldnmessages.md b/ldnmessages.md new file mode 100644 index 00000000..ccb6b731 --- /dev/null +++ b/ldnmessages.md @@ -0,0 +1,103 @@ +# LDN Messages Endpoints +[Back to the list of all defined endpoints](endpoints.md) + +## Main Endpoint +**/api/ldn/ldnmessages** + +Provide access to the ldn messages. List all the LDN messages + +A sample can be found at https://api7.dspace.org/server/#/server/api/ldn/ldnmessages + +Return codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access + +## Single LDN Message +**/api/ldn/ldnmessages/<:id>** + +```json +{ + "id" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", + "notificationId" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", + "queueStatus" : 1, + "queueStatusLabel" : "QUEUE_STATUS_QUEUED", + "context" : "7d95587b-8e26-4302-9911-3e0f40fc6e4b", + "object" : "7d95587b-8e26-4302-9911-3e0f40fc6e4b", + "target" : null, + "origin" : 1, + "inReplyTo" : null, + "activityStreamType" : "Announce", + "coarNotifyType" : "coar-notify:EndorsementAction", + "queueAttempts" : 0, + "queueLastStartTime" : null, + "queueTimeout" : "2024-01-03T10:56:41.737+00:00", + "notificationType" : "Incoming", + "type" : "message", + "_links" : { + "self" : { + "href" : "http://localhost/api/ldn/messages/urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f" + } + } +} +``` + +Status codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access +* 404 Not found - if no LDN Message exists with such id + +## Creating a new LDN Message +**POST /api/ldn/ldnmessages** + +Creation of LDN Message is not supported via Endpoint + +Status codes: +* 405 Method Not Allowed + +## PATCH + +Patch of LDN Message is not supported via Endpoint + +Status codes: +* 405 Method Not Allowed + +## DELETE + +Deletion of LDN Message is not supported via Endpoint + +Status codes: +* 405 Method Not Allowed + +## enqueueRetry +**/api/ldn/ldnmessages/enqueueretry/<:id>** + +this endpoint is responsible for requesting a reprocessing of LDN Message +by changing `queueStatusLabel` to be "QUEUE_STATUS_QUEUED_FOR_RETRY" +```json +{ + "id" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", + "notificationId" : "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f", + "queueStatus" : 7, + "queueStatusLabel" : "QUEUE_STATUS_QUEUED_FOR_RETRY", + "context" : "c433ac1a-949a-4435-bf3d-181dcaac1c56", + "object" : "c433ac1a-949a-4435-bf3d-181dcaac1c56", + "target" : null, + "origin" : 1, + "inReplyTo" : null, + "activityStreamType" : "Announce", + "coarNotifyType" : "coar-notify:EndorsementAction", + "queueAttempts" : 0, + "queueLastStartTime" : null, + "queueTimeout" : 1704281265044, + "notificationType" : "Incoming", + "type" : "message" +} +``` + +Status codes: +* 200 OK - if the operation succeed +* 401 Unauthorized - if you are not authenticated +* 403 Forbidden - if you are not logged in with sufficient permissions. Only system administrators can access +* 404 Not found - if no LDN Message exists with such id From e77e18bf14472037e584d2c8d99941260e7c09b5 Mon Sep 17 00:00:00 2001 From: mohamed eskander Date: Wed, 3 Jan 2024 14:59:29 +0200 Subject: [PATCH 2/3] refactoring --- submissioncoarnotifyconfigs.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/submissioncoarnotifyconfigs.md b/submissioncoarnotifyconfigs.md index 907deea3..ed995652 100644 --- a/submissioncoarnotifyconfigs.md +++ b/submissioncoarnotifyconfigs.md @@ -17,7 +17,16 @@ Returns the list of configured COAR notify patterns to be offered during the sub "_embedded" : { "submissioncoarnotifyconfigs" : [ { "id" : "coarnotify", - "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], + "patterns" : [ { + "pattern" : "request-review", + "multipleRequest" : true + }, { + "pattern" : "request-endorsement", + "multipleRequest" : true + }, { + "pattern" : "request-ingest", + "multipleRequest" : false + } ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { @@ -54,7 +63,16 @@ Provide detailed information about a specific COAR notify. ```json { "id" : "coarnotify", - "patterns" : [ "request-review", "request-endorsement", "request-ingest" ], + "patterns" : [ { + "pattern" : "request-review", + "multipleRequest" : true + }, { + "pattern" : "request-endorsement", + "multipleRequest" : true + }, { + "pattern" : "request-ingest", + "multipleRequest" : false + } ], "type" : "submissioncoarnotifyconfig", "_links" : { "self" : { From 0f9e43d4b107da8708992643d195eaebb480afa9 Mon Sep 17 00:00:00 2001 From: frabacche Date: Mon, 4 Mar 2024 09:04:44 +0100 Subject: [PATCH 3/3] move to POST /api/ldn/ldnmessages//enqueueretry --- ldnmessages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldnmessages.md b/ldnmessages.md index ccb6b731..c0eb7247 100644 --- a/ldnmessages.md +++ b/ldnmessages.md @@ -71,7 +71,7 @@ Status codes: * 405 Method Not Allowed ## enqueueRetry -**/api/ldn/ldnmessages/enqueueretry/<:id>** +**POST /api/ldn/ldnmessages/<:id>/enqueueretry** this endpoint is responsible for requesting a reprocessing of LDN Message by changing `queueStatusLabel` to be "QUEUE_STATUS_QUEUED_FOR_RETRY"