[buddypress-trac] [BuddyPress Trac] #8698: BP REST API Messages endpoint - additional recipient data

buddypress-trac noreply at wordpress.org
Fri Oct 28 00:39:41 UTC 2022


#8698: BP REST API Messages endpoint - additional recipient data
------------------------------------+--------------------------
 Reporter:  niftythree              |       Owner:  espellcaste
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  11.0.0
Component:  REST API                |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-reviewed  |
------------------------------------+--------------------------
Changes (by espellcaste):

 * keywords:  needs-patch dev-reviewed => has-patch dev-reviewed


Comment:

 Upon further reflection, I'm not sure the `_embed` approach is the best
 one for this use case.

 - First of all, the REST API requestor won't know the IDs of the
 recipients before it makes the request. Meaning that an embed won't be
 that useful since the user won't know which recipient user ID to use (he
 would need to know before making the request for the recipients).

 - Second, it would be impracticable to pass embeds to all recipients in
 the response. This could be a few or it could be hundreds/thousands of
 recipients. It all depends on the community/app.

 For custom recipient data, the best solution is for a dev to hook into
 `bp_rest_messages_prepare_recipient_value` and introduce their custom
 fields directly since we can't account for all scenarios.

 The name of a recipient/user, however, seems like relevant data to be
 expected by default, just like we are passing the avatars even though they
 are not default recipient data.

 See here: https://github.com/buddypress/wp-cli-buddypress/pull/97

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8698#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list