JulianAlejandroVil | 2023-01-19 16:25:28 UTC | #1
Hi, I succesfully created the connection to the API via the PureCloudPlatformClientV2 library and I was trying to use the Conversations API to get the conversations but it appears blank as shown
{'entities': [], 'pagesize': 0, 'pagenumber': 1, 'total': 0, 'firsturi': '/api/v2/conversations?pageSize=0&pageNumber=1', 'nexturi': None, 'previousuri': None, 'lasturi': '/api/v2/conversations?pageSize=0&pageNumber=1', 'selfuri': '/api/v2/conversations?pageSize=0&pageNumber=1', 'pagecount': 0}
This is the code i'm using in case it is of help (only the part for the conversations, i have tested it with other APIs and it works)
authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)
Conversations = PureCloudPlatformClientV2.ConversationsApi(apiclient) apianswer = Conversations.getconversations().to_dict()
tim.smith | 2023-01-19 17:12:25 UTC | #2
I'd start with changing your page size to a non-zero value. Asking for zero results per page isn't likely to yield a useful response.
Per the description for GET /api/v2/conversations "Get active conversations for the logged in user", this endpoint will only return conversations in which your user is actively participating. Make sure you're connected to a conversation while making this API request.
While this endpoint doesn't explicitly document the not.a.user error code, I would expect this endpoint to only work with user-based logins. Using client credentials won't ever return conversations here because there is no user in context and therefore there can't be any active conversations in that context.
system | 2023-02-19 17:12:57 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 18058