API parameter design

ساخت وبلاگ

آخرین مطالب

امکانات وب

I'm currently in the process of creating an API for a player management system trying to follow good restful API practices so others can easily use the API. My problem is lots of my endpoints are getting very long like the one below.

GET https://api.example.com/api/v1/players?region=any&qualified=0_g_or&north=0_g&east=0_g&sort=points_desc&page=0_20

I'm wondering if this is actually the best way of doing this? and if not what other methods are there

The specific request above gets all regional player data if they qualified e.g. greater than 0 or have gotten points in any region. Then sorts that by points desc and get the first page of size 20.

I feel as if it is a little convoluted, and am looking for a more intuitive design.

Thank you in advanced.

نویسنده : استخدام کار بازدید : 2 تاريخ : چهارشنبه 14 آذر 1397 ساعت: 19:05

تبلیغات در اینترنت