API question

Options
I have a table called Settings. There is one record per user.  I want to get the record by user_id.

When I attempted to create the API endpoint of settings/{user_id} I got an error message "This name is already being used by another query".  I can't see another API url like that.  Any suggestions?

[image.png]

[image.png]

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    ,

    You are getting that error because you have a variable in your URL.

    settings/{user_id}

    That is the equivalent to a wildcard - settings/*

    So if you had another api endpoint titled settings/stuff, then there would be a conflict since the API wouldn't know which endpoint to route to.

    The easiest fix would be to just change settings/{user_id} to settings2/{user_id}

    Anything that has a prefix that doesn't conflict with something already there.
  • Mr_English
    Options
    Thanks 

    Got it working as you suggested.