Go REST
B

https://gorest.co.in/public/v2/users

Bungsu about 2 months ago 413 views 1 replies

{meta:{pagination:{total:2970,pages:297,page:1,limit:10,links:{previous:null,current:https://gorest.co.in/public/v1/users?page=1,next:https://gorest.co.in/public/v1/users?page=2}}},data:[{id:8423673,name:Gov. Vedanshi Arora,email:gov_vedanshi_arora@zieme-haley.example,gender:male,status:inactive},{id:8423672,name:Devi Deshpande,email:deshpande_devi@abbott-reichel.test,gender:male,status:inactive},{id:8423671,name:Birjesh Kakkar,email:kakkar_birjesh@schimmel.example,gender:male,status:active},{id:8423670,name:Gandharva Dubashi MD,email:md_gandharva_dubashi@zemlak.example,gender:female,status:inactive},{id:8423669,name:Aadinath Reddy PhD,email:aadinath_reddy_phd@larson-schmidt.example,gender:male,status:active},{id:8423668,name:Kumari Bandopadhyay,email:bandopadhyay_kumari@schaden-willms.test,gender:male,status:active},{id:8423667,name:Madhuri Marar DDS,email:dds_madhuri_marar@kassulke.example,gender:female,status:inactive},{id:8423666,name:Miss Maheswar Pilla,email:pilla_miss_maheswar@green.example,gender:male,status:inactive},{id:8423665,name:Rev. Agniprava Nayar,email:nayar_agniprava_rev@lang.example,gender:female,status:active},{id:8423664,name:Amb. Bankimchandra Ahuja,email:bankimchandra_ahuja_amb@aufderhar.test,gender:male,status:inactive}]}

1 reply
Z
zeevy 23 days ago

Looks like the body got pasted as a sample response without an actual question - happy to help once you clarify what you're trying to do. A couple of guesses based on what you posted:

  1. If you wanted v2 (the title says /public/v2/users): v2 returns a flat array, with pagination in response headers (X-Pagination-Total, X-Pagination-Limit, etc.) - no meta: envelope.
  2. If you're using v1 (the body matches v1 format): the meta.pagination block you pasted is the documented v1 response shape. v1 is still available, but v2 is recommended for new code; see /docs for the differences between the two.

Drop a follow-up with the exact behavior you're stuck on and I'll dig in.

Your reply

Markdown supported