diff --git a/articles/error-guide.mdx b/articles/error-guide.mdx index af8eddb79..bcfe328e1 100644 --- a/articles/error-guide.mdx +++ b/articles/error-guide.mdx @@ -64,8 +64,8 @@ description: "Common error codes and their descriptions for CometChat REST APIs. | **Message Errors** | | | `ERR_EMPTY_RECEIVER` | Indicates that the receiver cannot be empty. | | `ERR_INVALID_RECEIVER_TYPE` | Indicates that the invalid receiver type. | -| `ERR_CONVERSATION_NOT_FOUND` | Indicates that the conversation id does not exists. | -| `ERR_CONVERSATION_NOT_ACCESSIBLE` | Indicates that the conversation id not accessible to the user. 1. A user can access his own one-to-one conversations. 2. A user can access the group conversations if he is member of the group. | +| `ERR_CONVERSATION_NOT_FOUND` | Indicates that the conversation id does not exists. This error code applies only to the deprecated `getConversation` and `deleteConversation` APIs. | +| `ERR_CONVERSATION_NOT_ACCESSIBLE` | Indicates that the conversation id not accessible to the user. 1. A user can access his own one-to-one conversations. 2. A user can access the group conversations if he is member of the group. This error is also thrown when the conversation has no messages yet, as the conversation has not been created on CometChat. | | `ERR_USER_MESSAGE_DELETE_FAILED` | Indicates that the API has failed to delete a one-to-one message. | | `ERR_MESSAGE_ID_NOT_FOUND` | Indicates that the message does not exist. | | `ERR_INVALID_MESSAGE_DATA` | Indicates invalid message body. | diff --git a/fundamentals/notification-extensions.mdx b/fundamentals/notification-extensions.mdx index 023415c4f..4b391d2f1 100644 --- a/fundamentals/notification-extensions.mdx +++ b/fundamentals/notification-extensions.mdx @@ -13,8 +13,8 @@ CometChat Notifications come in two variants: 2. The Legacy Notification Extensions based on CometChat Extensions. - * [Legacy Push Notifications Extension](/notifications/web-push-notifications) - * [Legacy Email Notifications Extension](/notifications/email-notifications-extension-legacy) - * [Legacy SMS Notifications Extension](/notifications/sms-notifications-extension-legacy) + * [Legacy Push Notifications Extension](https://assets.cometchat.io/legacy-docs/notifications/push-notifications-extension-legacy.html) + * [Legacy Email Notifications Extension](https://assets.cometchat.io/legacy-docs/notifications/email-notifications-extension-legacy.html) + * [Legacy SMS Notifications Extension](https://assets.cometchat.io/legacy-docs/notifications/sms-notifications-extension-legacy.html) For the best experience, we recommend to use the mordern [Notifications](/notifications/overview) platform. Please visit the above mentioned links for more details. diff --git a/rest-api/conversations.mdx b/rest-api/conversations.mdx index a23a2a2de..700f352d2 100644 --- a/rest-api/conversations.mdx +++ b/rest-api/conversations.mdx @@ -52,10 +52,11 @@ A **Conversation** represents an ongoing message exchange between a user and ano ### Error handling -| Error Code | Description | -| ---------------------------- | ----------------------------------------- | -| `ERR_UID_NOT_FOUND` | The specified user does not exist | -| `ERR_CONVERSATION_NOT_FOUND` | The specified conversation does not exist | +| Error Code | Description | +| --------------------------------- | ----------------------------------------- | +| `ERR_UID_NOT_FOUND` | The specified user does not exist | +| `ERR_CONVERSATION_NOT_FOUND` | The specified conversation does not exist. This error code applies only to the deprecated [Get Conversation](/rest-api/conversations/get-conversation) and [Delete Conversation](/rest-api/conversations/delete-conversation) APIs. | +| `ERR_CONVERSATION_NOT_ACCESSIBLE` | The conversation is not accessible to the user. A user can access their own one-to-one conversations, and group conversations they are a member of. This error is also thrown when the conversation has no messages yet, as the conversation has not been created on CometChat. | For the complete list of error codes, see [Error Guide](/articles/error-guide). diff --git a/sdk/javascript/error-codes.mdx b/sdk/javascript/error-codes.mdx index 2d8309c99..3da7c78c6 100644 --- a/sdk/javascript/error-codes.mdx +++ b/sdk/javascript/error-codes.mdx @@ -136,6 +136,16 @@ try { |------|---------| | `INVALID_CONVERSATION_TYPE` | Conversation type can be `user` or `group`. | | `CONVERSATION_NOT_FOUND` | Conversation not found. Check the value of conversationWith and conversationType. | +| `ERR_CONVERSATION_NOT_ACCESSIBLE` | The conversation is not accessible to the requesting user. | + + +`ERR_CONVERSATION_NOT_ACCESSIBLE` is the **normal, expected response when no conversation exists yet** between the two users — not just when a user tries to open a conversation with themselves. A one-to-one conversation only becomes accessible once at least one message has been exchanged (a user can access their own one-to-one conversations, and group conversations they are a member of). + +To create the conversation so it can be fetched, use one of these approaches: + +- **Send and delete a message** between the two users to instantiate the conversation, or +- **Use the [Add Friends API](/rest-api/friends)** with `addToConversations: true` so the conversation is created when the friendship is established. + ## Receipt Errors