Hi,
I need to get the conversation details using this api endpoint /api/v2/conversations/chats/{conversationId}
however i get a 401 using the SDK
What i did:
1.
let client = purecloudPlatformClient.ApiClient.instance;
client.config.setConfigPath('......./config/genesys.json');
loginResponse = await client.loginClientCredentialsGrant(process.env.GENESYS_CLIENT_ID, process.env.GENESYS_CLIENT_SECRET);
redis.set(${id}_loginToken
, JSON.stringify(loginResponse));
This works, because i then use this to start a webchat conversation and there is no error there
- to get the conversation
let loginResponse = await this.redisWrapper.get(`${id}_loginToken`); client.setAccessToken(loginResponse.accessToken);
again this returns the proper token and then we set it
const apiInstance = new purecloudPlatformClient.ConversationsApi();
return apiInstance.getConversation(conversationId);
the last bit where i try to do get conversation resturn an error. The weird thing is that sometimes (like 2%) of the time it works.
What are we doing wrong? Thank you