• Resolved compil3

    (@compil3)


    Hello everyone,

    I seem to be having trouble build a URL to fetch data on the Player Schema. Currently I can find a player using wp-json/sportspress/v2/players?slug=PLAYERNAME but I’ve run into an issue. If a player has requested a name change, the slug stays the same but their Rendered name is different. Now in order to remember these changes to look up the correct slug either involves using a database for our app to bind the new-name to slug or remembering what it was. Now with over 2500+ members it’s highly unlikely that our moderators/admins will remember everyone’s sign up name.

    My question is this:
    Is there a way to look up a players “rendered” name using a URL and retreiving the json data as if we used .../v2/players?slug=NAME or is there any other way?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter compil3

    (@compil3)

    I am not sure if the slug data changes if a member decides to change their player info, if it does not change automatically then a fix (including a script to go through the db and change it automatically), will need to be issued as doing so manually will take a very long time.

    Thread Starter compil3

    (@compil3)

    I figure it out .../v2/players?search=NAME

    Roch

    (@rochesterj)

    I’m glad it’s resolved!

    And thanks for sharing the solution.

    If you need anything else, just let us know.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘RESTapi’ is closed to new replies.