Khaled Dafar
Hello Ploi Support Team,
I hope this message finds you well.
I am writing with a question and a feature request regarding the sites API endpoint: /api/servers/{serverId}/sites.
Currently, when a new site is created (e.g., via the cloning process), it appears at the very end of the paginated list of sites. To find the ID of this newly created site via the API, I have implemented a process in my code that:
Waits for the source site's status to no longer be clone-in-progress. Once the clone operation is complete, it begins searching for the new site by its domain. This search requires me to make a GET request to the first page of the sites list, check the results, and if the new site isn't there, follow the links.next URL to the next page. I have to repeat this process until I have paginated through the entire list of sites on the server to find the one that was just created. This method works, but it's highly inefficient, especially on servers with a large number of sites. It results in many unnecessary API calls just to locate the most recent entry.
My Request:
Could you please consider adding a sorting parameter to the /api/servers/{serverId}/sites endpoint? Being able to sort by creation date in descending order would be a significant improvement.
For example, an ideal API call would look something like this:
GET /api/servers/12345/sites?sort=-created_at
This would return the most recently created sites on the first page, allowing me to find the new site with a single API call instead of potentially dozens.
Thank you for your fantastic platform and for considering this request to improve the API for all users.
API Enhancement Request: Sorting Sites by Creation Date
-
Dennis moved item to board Planned
1 day ago -
Khaled Dafar moved item to project API Level Requests
1 week ago -
Khaled Dafar created the item
1 week ago