9

I was wondering whether there are recent any changes to the /users endpoint of Stack Exchange API? I was sending queries that worked previously (also worked yesterday), but I got error code id of 404 today.

Here is a reproducible code with two random user ids: https://api.stackexchange.com/2.3/users/7329832;209103?key=UOntWUjxR8OUgA0BpKFeEg%28%28&site=stackoverflow&order=desc&sort=reputation&filter=%21%2AMg4PjfXdyMcuySE&pagesize=100&page=1

And I got:

{
   "error_id": 404,
   "error_message":"no method found with this name",
   "error_name":"no_method"
}

Though, the API query works for some of the users, for example,

https://api.stackexchange.com/2.3/users/1234;5678?key=UOntWUjxR8OUgA0BpKFeEg%28%28&site=stackoverflow&order=desc&sort=reputation&filter=%21%2AMg4PjfXdyMcuySE&pagesize=100&page=1

Not sure about the possible reason?

3
  • Couldn't that just mean that the user was not found?
    – Cerbrus
    Commented Sep 28, 2023 at 8:41
  • Hello @Cerbrus, thanks for replying! The two users actually exist, stackoverflow.com/search?q=user%3A7329832, and stackoverflow.com/search?q=user%3A209103. So I am not sure why the API query will return an error...
    – mago
    Commented Sep 28, 2023 at 8:49
  • 2
    It looks like the issue is specifically for user 209103. There is no issue for me querying the other three users you've mentioned. Commented Sep 28, 2023 at 9:36

2 Answers 2

11

The fix has been deployed to production and the issue is resolved.

Major kudos to @andrew-t for figuring out this was specific to RMs in the new Mobile Dev collective! And thanks to @mago for reporting the issue with clear steps to reproduce!

For those interested, the issue was related to a new variant of the "Recognized Member" role that we launched along with the Mobile Dev collective. Unfortunately, an enum in the APIv2 code didn't get updated to include that new role, resulting in a parsing error in the backend. The fix was to update the enum and deploy.

0
10

This only occurs to some members of the new "Mobile Development" Collective.

All users who are a Recognized member of that collective will return the same error, if the collectives field is requested.

If the collectives field is disabled, then it is possible to return the result successfully. Example: https://api.stackexchange.com/2.3/users/209103?order=desc&sort=reputation&site=stackoverflow&filter=!WsdSnckPLma4b%28r_dYFcIEn3RhoCGDe41-In

{
  "items": [
    {
      "badge_counts": {
        "bronze": 813,
        "silver": 833,
        "gold": 79
      },
      "view_count": 128836,
      "down_vote_count": 4473,
      "up_vote_count": 20171,
      "answer_count": 17136,
      "question_count": 25,
      "account_id": 72426,
      "is_employee": false,
      "last_modified_date": 1695704700,
      "last_access_date": 1695882931,
      "reputation_change_year": 30973,
      "reputation_change_quarter": 8022,
      "reputation_change_month": 1874,
      "reputation_change_week": 373,
      "reputation_change_day": 38,
      "reputation": 567405,
      "creation_date": 1257978627,
      "user_type": "registered",
      "user_id": 209103,
      "accept_rate": 73,
      "about_me": "\u003Cp\u003EI am an engineer for Firebase at Google.\u003C/p\u003E\n\n\u003Cp\u003EI respond equally well to being called \"Frank\" or \"puf\".\u003C/p\u003E\n",
      "location": "San Francisco, CA",
      "website_url": "",
      "link": "https://stackoverflow.com/users/209103/frank-van-puffelen",
      "profile_image": "https://www.gravatar.com/avatar/12d378e6a9788ab9c94bbafe242b82b4?s=256&d=identicon&r=PG",
      "display_name": "Frank van Puffelen"
    }
  ],
  "has_more": false,
  "quota_max": 300,
  "quota_remaining": 160,
  "page": 1,
  "page_size": 30,
  "total": 1,
  "type": "user"
}
1
  • 3
    Awesome sleuthing, @Andrew T. !
    – John Wright StaffMod
    Commented Sep 28, 2023 at 16:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .