diff --git a/api-reference/connect/webhooks/patch-webhook.mdx b/api-reference/connect/webhooks/patch-webhook.mdx new file mode 100644 index 00000000..47daa696 --- /dev/null +++ b/api-reference/connect/webhooks/patch-webhook.mdx @@ -0,0 +1,3 @@ +--- +openapi: patch /notification/v1/connect/webhook/subscriptions/{id} +--- \ No newline at end of file diff --git a/api-reference/connect/webhooks/put-webhook.mdx b/api-reference/connect/webhooks/put-webhook.mdx new file mode 100644 index 00000000..4c423f4d --- /dev/null +++ b/api-reference/connect/webhooks/put-webhook.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /notification/v1/connect/webhook/subscriptions/{id} +--- \ No newline at end of file diff --git a/api-reference/connect/webhooks/webhooks.yml b/api-reference/connect/webhooks/webhooks.yml index 6fbc2ecd..ab272ce7 100644 --- a/api-reference/connect/webhooks/webhooks.yml +++ b/api-reference/connect/webhooks/webhooks.yml @@ -274,12 +274,234 @@ paths: example: "SERVER_ERROR" /notification/v1/connect/webhook/subscriptions/{id}: + patch: + tags: + - Webhooks + summary: Add Event to Webhook + description: | + Adds a new event to the specified webhook. The `id` path parameter identifies the webhook. The request body must include the `event_id` to be added. + security: + - bearerAuth: [ ] + parameters: + - name: id + in: path + required: true + description: The unique identifier of the webhook. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + event_id: + type: string + description: The event to add to the webhook. + example: "prescription.created" + required: + - event_id + responses: + '200': + description: Event added successfully. + content: + application/json: + schema: + type: object + properties: + msg: + type: string + example: "webhook event added successfully" + status: + type: string + example: "success" + '400': + description: Bad request. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Invalid event" + code: + type: string + example: "INVALID_REQUEST" + '401': + description: Unauthorized request. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Unauthorized request" + code: + type: string + example: "INVALID_REQUEST" + '404': + description: Webhook not found. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Webhook not found" + code: + type: string + example: "INVALID_REQUEST" + '500': + description: Server error. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Internal Server Error" + code: + type: string + example: "SERVER_ERROR" + + put: + tags: + - Webhooks + summary: Update Webhook + description: | + Updates the specified webhook. The `id` path parameter identifies the webhook. The request body must include the new `event_ids` array and optionally a new `signing_key`. + security: + - bearerAuth: [ ] + parameters: + - name: id + in: path + required: true + description: The unique identifier of the webhook. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + event_ids: + type: array + items: + type: string + description: List of event names to update for the webhook. + example: + - "rec.srp" + - "user.data.access" + - "appointment.created" + signing_key: + type: string + description: New signing key for the webhook. + example: "supersigningkey1" + required: + - event_ids + responses: + '200': + description: Webhook updated successfully. + content: + application/json: + schema: + type: object + properties: + msg: + type: string + example: "webhook updated successfully" + status: + type: string + example: "success" + '400': + description: Bad request. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Invalid request" + code: + type: string + example: "INVALID_REQUEST" + '401': + description: Unauthorized request. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Unauthorized request" + code: + type: string + example: "INVALID_REQUEST" + '404': + description: Webhook not found. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Webhook not found" + code: + type: string + example: "INVALID_REQUEST" + '500': + description: Server error. + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + message: + type: string + example: "Internal Server Error" + code: + type: string + example: "SERVER_ERROR" delete: tags: - Webhooks summary: Delete a Webhook description: | - Deletes an existing webhook based on its ID. This endpoint allows partners to remove a previously registered webhook by specifying its unique identifier in the path parameter. The `id` parameter is required and must match the ID of the webhook to be deleted. Upon successful deletion, the service will no longer send POST requests to the webhook's URL for the specified scope. This operation helps partners manage and clean up their webhook configurations. + Deletes an existing webhook based on its ID. This endpoint allows partners to remove a previously registered webhook by specifying its unique identifier in the path parameter. The `id` parameter is required and must match the ID of the webhook to be deleted. Upon successful deletion, the service will no longer send POST requests to the webhook's URL for the specified scope. security: - bearerAuth: [ ] parameters: diff --git a/api-reference/user-app/notifications/fcm-creds.mdx b/api-reference/user-app/notifications/fcm-creds.mdx deleted file mode 100644 index 43c41a0c..00000000 --- a/api-reference/user-app/notifications/fcm-creds.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: post /notification/fcm-creds ---- \ No newline at end of file diff --git a/api-reference/user-app/notifications/notification.yml b/api-reference/user-app/notifications/notification.yml index 35a21c82..383c7e99 100644 --- a/api-reference/user-app/notifications/notification.yml +++ b/api-reference/user-app/notifications/notification.yml @@ -241,49 +241,6 @@ paths: example: message: Unauthorized access. error_code: 401 - '500': - description: Server error response - content: - application/json: - schema: - type: object - example: - message: Internal server error. - error_code: 500 - /notification/fcm-creds: - post: - operationId: addFcmCreds - tags: - - Notifications - summary: Add FCM Credentials - description: | - Store FCM credentials. This endpoint allows clients to store Firebase Cloud Messaging (FCM) credentials by providing the service account key details. The stored credentials will be used for sending notifications to the registered devices. The request body must contain the FCM payload information. - security: - - bearerAuth: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/FCMPayload' - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - example: - message: FCM token added successfully - '400': - description: Client error response - content: - application/json: - schema: - type: object - example: - message: Unauthorized access. - error_code: 401 '500': description: Server error response content: diff --git a/docs.json b/docs.json index ca22ee7a..230a8a23 100644 --- a/docs.json +++ b/docs.json @@ -54,6 +54,8 @@ "api-reference/connect/webhooks/webhook-signature", "api-reference/connect/webhooks/register-webhook", "api-reference/connect/webhooks/get-webhooks", + "api-reference/connect/webhooks/patch-webhook", + "api-reference/connect/webhooks/put-webhook", "api-reference/connect/webhooks/delete-webhook", "api-reference/connect/webhooks/webhook-samples" ] @@ -609,8 +611,7 @@ "icon": "bell", "pages": [ "api-reference/user-app/notifications/add-device", - "api-reference/user-app/notifications/delete-device", - "api-reference/user-app/notifications/fcm-creds" + "api-reference/user-app/notifications/delete-device" ] }, { diff --git a/mint_old_deprecated.json b/mint_old_deprecated.json index 3f763cdb..6cf81788 100644 --- a/mint_old_deprecated.json +++ b/mint_old_deprecated.json @@ -736,8 +736,7 @@ "icon": "bell", "pages": [ "api-reference/user-app/notifications/add-device", - "api-reference/user-app/notifications/delete-device", - "api-reference/user-app/notifications/fcm-creds" + "api-reference/user-app/notifications/delete-device" ] }, {