# Xano Datasource strange Endpoint call

**URL:** <https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537>\
**Category:** How do I?\
**Tags:** collection-page, xano\
**Created:** [March 12, 2024, 3:09pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537 "2024-03-12T15:09:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)\
**Post date:** [March 12, 2024, 3:09pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/1 "2024-03-12T15:09:42Z")

</div>

Hi there,

In Xano I have two endpoints

GET /organizations - Fetch all organizations  
GET /organizations/{organization\_id} - Fetch details of organisation (by row click, navigate to details page with organization\_id as url parameter) /organization-details/342

I was inspecting network traffic, because I find Weweb+Xano rather slow rendering data at some points, which should not be the case.

I noticed that when I go to a organization details page the following endpoint is triggered.

xanohostname/api:code/organizations/342?organization\_id=342

You can see a duplicate reference Why is Weweb adding ?organization\_id=342. How can I solve this I want to have xanohostname/api:code/organizations/342 (preferably) or xanohostname/api:code/organizations?organization\_id=342

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)\
**Post date:** [March 13, 2024, 2:23pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/2 "2024-03-13T14:23:16Z")

</div>

@FHEXL it looks like you might be using static collection pages and additionally pass the parameter as URL variable. I double checked mine endpoints and everything looks fine. I’m not using dynamic collection pages and pass variables in URLs.

---

<div class="post-metadata">

**Author:** ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)\
**Post date:** [March 13, 2024, 3:09pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/3 "2024-03-13T15:09:02Z")

</div>

Thanks, I will check this out. Maybe for some clarification:

- Weweb URL /organizations/342
- Xano URL api/organizations/{organization\_id} input=organization\_id (integer)

Looking at the network inspector in the Weweb preview app on page /organization/342 the xano endpoint is called as api/organizations/342?organization\_id=342

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)\
**Post date:** [March 13, 2024, 3:29pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/4 "2024-03-13T15:29:25Z")

</div>

@FHEXL you have to delete {organization\_id} form XANO api. After that it works as you like. I’m not using this and that is why mine are OK.

---

<div class="post-metadata">

**Author:** ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)\
**Post date:** [March 13, 2024, 7:57pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/5 "2024-03-13T19:57:23Z")

</div>

Ok thanks, but how would you make a distinction between a GET endpoint to fetch all organizations and to fetch only one.

Options I am thinking about:

- GET Organization **s** (\* all organizations)
- GET Organization (single organizations)

Or should you only use 1 one endpoint

- GET Organizations (In Xano function stack I add a conditional. When input param organization\_id is empty I query all organizations, when organization\_id is not empty I fetch only 1 record.
- In Weweb I add two collections All organizations where I leave the input param empty and a collection for Single organization where I bind the input param.

Looking forward to see your proposed approach.

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)\
**Post date:** [March 13, 2024, 9:08pm UTC](https://community.weweb.io/t/xano-datasource-strange-endpoint-call/7537/6 "2024-03-13T21:08:09Z")

</div>

I give them distinct names: single\_organization, single\_company\_contact etc… For me such way is much more readable… And I’m not using GET Single record in XANO at all. I always use select multiple records even when I know there will be only one. Since I’m developing multitenant app this is the only resonable way to use more filters in SELECT without the need of filtering afterwards. Since this is PostgreSQL the backend SQL is the same - so there is no negative impact on performance.  
I’m using different endpoints for different purposes, so GET one record is one endpoint and get multiple records is second one. When you have a lot of them it is much easier to maintain.
