API works in xano but not in browser

Options
This seems like something very simple, but...
I built an API request with a single input /artist/{member_id} that works fine in the API builder.

I am constructing a URL GET request in javascript using Prakash's example with Webflow front end, like: WMX • Part 2 • How to build a Membership site with Webflow, MemberStack, and Xano

I don't think this is a JavaScript issue.  Something to do with proper construction of the URL to perform the GET API.  Or maybe a bug?

The Xano endpoint I copied is:
https://x8ki-letl-twmt.n7.xano.io/api:arLEd2EP/artist/{member_id}

and after I add the webflowMemberId:
https://x8ki-letl-twmt.n7.xano.io/api:arLEd2EP/artist/61ffb97c85b43c04fec34eba

Pasting that into a browser I get a 404 error.  That leads me to think I'm missing quotes or something else simple.

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    I get that error when I have a good endpoint but the id doesn't match what's in the database. (The question of which error code throws is controllable by the call to "Precondition") 

    Can you share a screenshot of what the function stack looks like? And are you sure there is an entity in the table that matches this particular value in the field being queried?
  • David Richardson
    Options
    It's strange this was working a bit ago.  I am using the WMX structure to link permissions for different memberships (Memberstack)  The Webflow UUID is then shared between Memberstack and Xano.  That Webflow UUID ties together different data entered into the application.  I am using the UUID (which maintains data integrity) to load data from users: registration, artwork etc. 

    I start the API with the webflowMemberId:[the stack 01.jpg]I am matching a text field to a text input.  The output is only partially successful now. 
    [the stack 02.jpg]The API now displays the record from the members table.  But that data was "addedon" with data from the "artist" table.  THAT data is no longer showing up.  Not sure why.  This API was working. I might expect the rest of the data would display from the artist table in the output [the stack 03.jpg]In any case the API STILL works in the Xano environment but it gives a 404 response in a browser.  I'll keep attempting to sort out the addon output so IT shows up when I run the API in Xano.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     your parameter name is different in your URL and query. Make this the same and you should see the results you expect:

    [CleanShot 2022-02-23 at 11.54.44.png]
  • David Richardson
    Options
    Thank you Michael.  That helped in this instance.  I'd like to ask some question that relate to both my instance and also hopefully be relevant to others regarding documentation.
    I reference the WMX template structure and Webflow Member ID and how it might be used by others.  The members table connects other tables together directly and with joins and table references in table fields.  That is really useful.  One might expect that the webflowMemberId or (Memberstack webflow-member-id) could provide a map all data relevant to one member I'd use in the website.
    Referencing what you pointed out above, it might be helpful to somewhere in your documentation on GET requests, provide a visual, something like this:[input names MUST be the same.jpg]To offer a deeper understanding of the mechanics of creating and
    modifying an API request, the Xano interface might be more clear.[field_names.jpg]The addons is a great feature but the interface is not intuitive.  Different variables will of course produce different results and debugging is part of the learning curve. 

     When I see this: [parent object name.jpg]
    I might expect that the variable artistData is included in the JSON output when the API runs.  Instead there is this: [artistData null.jpg]Debugging does not offer any explanation as to why artistData is null.  I'd like to be able to figure this out.  Not a clue.

    When creating the addon (see below) it is not intuitive what the two fields outlined in red map to - or what they do - in what table hence getting the output results one believes they might get actually show up in the JSON output.  This might be a "feature request": a clearer understanding what these elements are and what they do would be helpful: a popup or hover information element.[addon input fields not mapped.jpg]Still, I'd still like the data in the artist table referenced in the addon to be present in the JSON output.  Wish I knew how to get there.  Thanks
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     in one of your screenshots you say they both have the same name but they do not.

    field_name and field_value

    Did you mean something else?
  • David Richardson
    Options
    😆
    Hey Sean, thanks for pointing that out.  I'm most definitely a senior with poor eyesight, a feeble brain and dyslexic.  Pitiful.  But not looking for pity.  Still, the Xano UI has a lot of moving parts.  The Chrome Dev Tool UI is complex too as is Adobe Illustrator or Photoshop or Autodesk Fusion 360.  I mentioned to Michael that some videos or documentation focused just on the UI would be useful.  Feature request: an HTML tooltip might be useful to the noob "no-coders" to remind us what we're looking at.

    I should mention that I got this all sorted.  I was not using the id fields to link the tables but a text field.  Once I got my tables set up properly, the addons worked.  All good here.