[wp-meta] [Making WordPress.org] #6313: Users API endpoint is not returng all the users available

Making WordPress.org noreply at wordpress.org
Tue May 17 01:13:05 UTC 2022


#6313: Users API endpoint is not returng all the users available
-----------------------------+-----------------------
 Reporter:  krysal           |       Owner:  dd32
     Type:  defect (bug)     |      Status:  accepted
 Priority:  high             |   Milestone:
Component:  Photo Directory  |  Resolution:
 Keywords:                   |
-----------------------------+-----------------------

Comment (by dd32):

 Replying to [comment:2 krysal]:
 > What is the difference between the shown and hidden users in
 https://wordpress.org/photos/wp-json/wp/v2/users? It's still unclear to
 me.

 In short:
  - The WordPress user endpoint is only published authors, able to list all
 published authors, and has edit functionality, and is only accessible via
 user ID
  - The WPORG user endpoint is all users, non-listable, by user-slug only,
 and not possible to be used to edit users.

 The Content of the endpoints should be close enough to the same for you
 not to notice the difference.

 > The script for the photo directory will need some small changes if only
 the `https://wordpress.org/photos/wp-json/wp/v2/photos` endpoint is
 changing but we can work with it, and would be a huge improvement.

 The endpoint itself shouldn't change too much, instead of
 {{{
 "author": [
         {
           "embeddable": true,
           "href": "https://wordpress.org/photos/wp-
 json/wp/v2/users/148148"
         }
       ]
 }}}
 you'll see
 {{{
 "author": [
         {
           "embeddable": true,
           "href": "https://wordpress.org/photos/wp-
 json/wporg/v1/users/dd32"
         }
       ]
 }}}

 And when you request the photos URL with `?_embed=true` you'll see that
 author response embedded into the same request, rather than having to make
 the second request.

 > we are trying to get the user for the images but as most links are
 invalid, they aren't shown on the image details page

 Is that just related to the author? Or are you seeing other invalid links?

 A quick glance at Openverse does show that the source-URLs you're using
 are lacking the trailing slash, but they should be present / looks like
 they're present in the API.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/6313#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list