SOLVED

Re: I want to fetch the campaigns sorted by lastModified through REST API

Go to solution
Anonymous
Not applicable

I want to fetch the campaigns sorted by lastModified through REST API

I want to fetch the campaigns sorted by lastModified. Nowhere in the wiki/documentation it has mentioned. So thought of asking here.

I have tried these query params.

https://XXX-JLV-319.mktorest.com/rest/asset/v1/programs.json?sort=last_modified&dir=DESC&direction=D...

Anybody knows what are the correct params.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: I want to fetch the campaigns sorted by lastModified through REST API

I am sure, yes.

Retrieve the assets and sort them client-side.

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: I want to fetch the campaigns sorted by lastModified through REST API

Why would you assume there are such parameters, as they're not in the docs/Swagger? You can't just invent an API....

Anonymous
Not applicable

Re: I want to fetch the campaigns sorted by lastModified through REST API

Its not about inventing an API.

I didn't get much information in the docs/Swagger API, so asking here.

And these query parameters sort=last_modified&dir=DESC&direction=DESC were used from the UI portal. So thought of using for RES...

Are you sure that the REST APIs doesn't provide any 'sort by' functionality as its not there in docs/Swagger ?

SanfordWhiteman
Level 10 - Community Moderator

Re: I want to fetch the campaigns sorted by lastModified through REST API

I am sure, yes.

Retrieve the assets and sort them client-side.

Anonymous
Not applicable

Re: I want to fetch the campaigns sorted by lastModified through REST API

Thanks for the information

Anonymous
Not applicable

Re: I want to fetch the campaigns sorted by lastModified through REST API

But the problem we are facing here is, we have thousands of programs and the list grows.

So its really a bad idea to fetch all the programs at client side in a paginated way and sorting them by lastModified field.

After all we need to maintain the pagination on our end as well with respect to lastModified field.

So is there any plan to provide sortBy functionality for REST APIs.

SanfordWhiteman
Level 10 - Community Moderator

Re: I want to fetch the campaigns sorted by lastModified through REST API

I don't believe there's a plan to do server-side sorting. After all, that's more resource utilization that's more efficient to push to the client. I do know there was supposed to be date filtering added recently, so you could just get the latest changes and sort that into your saved results. But it isn't implemented as far as I can see.