Skip to content

Commit

Permalink
Fix Reconnectable Chats API (#124)
Browse files Browse the repository at this point in the history
* Update interface to support 'requestId' property as optional parameter

* Update request path to use request id if set

* Update CHANGELOG.md
  • Loading branch information
xTEddie authored Oct 23, 2024
1 parent a2ffc49 commit 601fe88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ All notable changes to this project will be documented in this file.
- logging response errorCode into telemetry logs
- Improve telemetry to uniformly log all errors for reconnectable chat and reconnect availability

### Fixed
- Add `requestId` as optional parameters for `getReconnectableChats()`

## [0.5.6]

### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/Interfaces/IReconnectableChatsParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export default interface IReconnectableChatsParams {
* JWT token from the portal
*/
authenticatedUserToken: string;
requestId?: string;
}
2 changes: 1 addition & 1 deletion src/SDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export default class SDK implements ISDK {
const { authenticatedUserToken } = reconnectableChatsParams;
this.logWithLogger(LogLevel.INFO, OCSDKTelemetryEvent.GETRECONNECTABLECHATSSTARTED, "Get Reconnectable chat Started");

const requestPath = `/${OmnichannelEndpoints.LiveChatGetReconnectableChatsPath}/${this.omnichannelConfiguration.orgId}/${this.omnichannelConfiguration.widgetId}/${this.omnichannelConfiguration.orgId}?channelId=${this.omnichannelConfiguration.channelId}`;
const requestPath = `/${OmnichannelEndpoints.LiveChatGetReconnectableChatsPath}/${this.omnichannelConfiguration.orgId}/${this.omnichannelConfiguration.widgetId}/${reconnectableChatsParams?.requestId || this.omnichannelConfiguration.orgId}?channelId=${this.omnichannelConfiguration.channelId}`;
const requestHeaders: StringMap = Constants.defaultHeaders;
requestHeaders[OmnichannelHTTPHeaders.authenticatedUserToken] = authenticatedUserToken;
requestHeaders[OmnichannelHTTPHeaders.authCodeNonce] = this.configuration.authCodeNonce;
Expand Down

0 comments on commit 601fe88

Please sign in to comment.