Guide on QUERY-STRING PARAMETERS

Is there a guide on how to use QUERY-STRING PARAMETERS? I can’t seems to find any guide or any info about the parameters. Any help would be helpful and appreciated. Thanks.

Hi,

I’m not sure what you’re referring to?

Sorry, what I meant is the API documentation.

I tried to go to the model class to look into it, but I don’t get what it’s use case for

Which parameter is unclear?

Hi, I am also curious about this.
I am looking to get tasks, and wondering what options I can use for query parameters…
I’ve tried googling around to no avail, and referenced the api doc shown here.
it says

Check each model for the list of associated includes

I just don’t know where to look for that or what I’m looking at.

Which query parameters can I use, and how do they work?

Thank you

You can see the options for tasks here:

https://api-docs.invoicing.co/#get-/api/v1/tasks

Those docs don’t seem to provide consistent detail about what exact query parameters can be used for all the endpoints. Some of them have pretty good detail, but others seem to reference the code directly, such as the tasks endpoint pointing to the TaskFilters class:

Query parameters can be added to performed more fine grained filtering of the tasks, these are handled by the TaskFilters class which defines the methods available

By that I figure it means to look at the class source here: invoiceninja/app/Filters/TaskFilters.php at v5-stable · invoiceninja/invoiceninja · GitHub

I’m not exactly fluent in PHP, but can I assume that the method names in that class are what should be used as query parameters? I’ve tried a few of them, and haven’t been able to get any to work as I’d expect, but is it correct those (and the methods on the parent class QueryFilters) are the only ways to filter tasks at the moment?

For instance, I would like to query for only the tasks marked as “Running” status in the UI:

However, when using a query parameter of ?task_status=Running it doesn’t seem to limit the response at all; I still get hundreds of results instead of the 2 that I would expect. So, I figured maybe it needs a primary key value, so I loaded up phpMyAdmin and inspected the task_status table, only to find that there is not actually a status called “Running” despite that status showing in the UI, so I’m not sure what value I should be using to filter for that status.

I tried using some of the other task_status primary keys that I do see in the database, like ?task_status=7, but that returns an empty list, even though I have a bunch of tasks that are “In progress” (the task status which happens to have a id of 7 in my database).

Is there any other insight available as to how to use query parameters for endpoints that don’t have that detail yet and point to a PHP class instead?

One option is to use the React web app and view the API requests in the network tab of the browser console.