Removal of pagination fields from REST endpoint ("/api/v2/conversations/messages/{conversationId}/messages/bulk") response

Description

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

References

MSG-4209

IMHO, I think the total field shouldn't be removed, as it can be used to know how many messages are there without having to count them in the array...

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 ?

@Frederic_Bronner no other changes here, just to remove the unneeded pagination fields. You would still have the entities array in the response

@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.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.