From ad98fa7d16b9bd16da59ae6d7cca47fccb6197ac Mon Sep 17 00:00:00 2001 From: jselvam Date: Fri, 19 Jul 2024 11:56:27 -0700 Subject: [PATCH 1/2] ack api --- README.md | 22 ++++++++ inbound-interaction-api.yaml | 99 ++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/README.md b/README.md index 67f14e4..88e94b8 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,28 @@ curl -v -H $'Authorization: Bearer ' -H 'AuthorizationContext: /api/v1/route ``` +### Acknowledgement API + +Example request to acknowledge delivery / read of messages sent from agent. Be sure to replace placeholder values `<..>` + +```bash +curl -v -H $'Authorization: Bearer ' -H 'AuthorizationContext: ' -H 'RequestId: ' -H 'OrgId: ' -H 'Content-Type: application/json' -X POST -d "{ + \"sender\": { + \"appType\" : \"\", + \"subject\" : \"\", + \"role\" : \"\" + }, + \"conversationIdentifier\" : \"\", + \"acknowledgements\" : [ { + \"acknowledgementTimestamp\" : , + \"acknowledgementType\" : \"\", + \"acknowledgedConversationEntryIdentifier\" : \"\", + \"acknowledgmentCreatedConversationEntryIdentifier\" : \"\" + }, {..}, {..} . . . {..}] +}" /api/v1/acknowledgement +``` +Note: Only maximum of 25 acknowledgments are supported per request + ## outbound-custom-event-payload.yaml The [outbound-custom-event-payload.yaml](outbound-custom-event-payload.yaml) shows the outbound message custom event schema. Following are examples of the custom event payload received in "data" listener of the custome event after subscribe the event by topic name "my__event__e" shown in payload below for outbound message. diff --git a/inbound-interaction-api.yaml b/inbound-interaction-api.yaml index 75e2ef2..5bce492 100644 --- a/inbound-interaction-api.yaml +++ b/inbound-interaction-api.yaml @@ -522,6 +522,55 @@ components: type: "string" description: "UUID that references a message" example: "57904eb6-5352-4c5e-adf6-5f100572cf5d" + AcknowledgementRequest: + type: object + description: "Request body for acknowledgement API" + properties: + sender: + $ref: '#/components/schemas/Participant' + conversationIdentifier: + type: string + description: Conversation Identifier + maxLength: 240 + acknowledgements: + type: array + minItems: 1 + maxItems: 25 + description: "List of Read and Delivered acknowledgements" + items: + $ref: '#/components/schemas/Acknowledgement' + required: + - sender + - conversationIdentifier + - acknowledgements + Acknowledgement: + type: object + properties: + acknowledgementType: + $ref: '#/components/schemas/AcknowledgementType' + acknowledgedConversationEntryIdentifier: + type: string + description: The unique identifier for the conversation entry this acknowledgement is associated with + acknowledgmentCreatedConversationEntryIdentifier: + type: string + description: The client-supplied unique identifier to set when storing the new acknowledgement conversation entry + acknowledgementTimestamp: + type: string + description: The timestamp associated with the acknowledgement + required: + - acknowledgementType + - acknowledgedConversationEntryIdentifier + - acknowledgmentCreatedConversationEntryIdentifier + - acknowledgementTimestamp + AcknowledgementResponse: + type: object + description: "Response after sending read / delivered acknowledgment" + properties: + success: + type: boolean + description: Status of the consent status update request + required: + - success servers: - url: "/api/v1/" openapi: "3.0.0" @@ -781,6 +830,56 @@ paths: in: "header" required: true example: "f7904eb6-5352-4c5e-adf6-5f100572cf5d" + /acknowledgement: + post: + summary: Marks messages as read / delivered + operationId: post-acknowledgement + responses: + default: + description: Unsuccessful operation + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgementResponse' + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgementResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgementRequest' + parameters: + - in: header + name: Authorization + description: "The access token generated to make requests to the Interaction Service APIs" + example: Bearer XXXXXX + required: true + schema: + type: string + - name: OrgId + in: header + description: "Organization Id used to verify the request against the auth token" + example: 00Dxxxxxxxxxxxx + required: true + schema: + type: string + - name: AuthorizationContext + in: header + description: "Specify the extra info for request authorization" + required: true + schema: + type: string + - name: RequestId + in: header + description: "UUID that references this request" + required: true + schema: + type: string + example: f7904eb6-5352-4c5e-adf6-5f100572cf5d info: title: "Interaction" version: "0.0.1" From f49f3535ed4003bc58ac2d8cd0d6b83d18c7db38 Mon Sep 17 00:00:00 2001 From: jselvam Date: Fri, 19 Jul 2024 12:05:13 -0700 Subject: [PATCH 2/2] added AcknowledgementType --- inbound-interaction-api.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inbound-interaction-api.yaml b/inbound-interaction-api.yaml index 5bce492..0e1379e 100644 --- a/inbound-interaction-api.yaml +++ b/inbound-interaction-api.yaml @@ -571,6 +571,12 @@ components: description: Status of the consent status update request required: - success + AcknowledgementType: + description: Acknowledgement Type + type: string + enum: + - Read + - Delivered servers: - url: "/api/v1/" openapi: "3.0.0"