An API change is being made to POST Get messages in batch response contract. The following fields are being deprecated and will be removed.
firstUri
lastUri
pageCount
pageNumber
pageSize
selfUri
total
Change Category
API
Change Context
The following public APIs will be affected:
POST /api/v2/conversations/messages/{conversationId}/messages/bulk
Change Impact
Those pagination fields are not needed as this REST endpoint POST /api/v2/conversations/messages/{conversationId}/messages/bulk is not accepting any pagination field in the request body. So If customer is using those fields then this change causes NPE.
Date of Change
Sep 14, 2022
Impacted APIs
POST /api/v2/conversations/messages/{conversationId}/messages/bulk
Wondering about where the list of messages will be returned, it is currently returned in the entities array. Will it still be returned in entities, or will it be coming back as a root level array of MessageData ?
@Adrian_Santamaria you will still have the entities array in the response, you should just be able to do a .size() there for your array count. It should be no different processing vs. using a total field in the response was.
Some use cases come to my mind where that is not feasible. For example, one of them would be if that endpoint is called by a Data Action from within a script, as scripts cannot handle arrays.
@Adrian_Santamaria i'm not sure i follow. if the Scripts can't handle arrays, then how is the endpoint going to be used there? If you can't use the response, then how would a total field be of any use anyway? Also you are supplying the array of messages to Get here, so really you know the total you are asking for, before you call it anyway.
Oh, that was just an example, not a real scenario. It just came to my mind that there might be some situations where processing the array could be not possible.