Jump to content

PostDisplaypreferencesByDisplaypreferencesid


PlutoIsAPlanet
Go to solution Solved by ebr,

Recommended Posts

PlutoIsAPlanet

Greetings all,

first of all just a little gratitude on my part, I recently went ahead and got the Lifetime pass. Keep up the great work 👍

I would like to use the API and set the view type i.e. from "Primary" to "List" for any given folder.

image.png.fcec94bb14d4873facf09b1d453f2b7e.png

I thought that I'd use the DisplayPreferencesService to grab the DisplayPreferences object via getDisplaypreferencesById as that object looks promising, as it has some of the properties on display there (view type, sort order, sort by etc.).

If I invoke the method, passing on the folder id of the page I want to modify, I get the following back (Insomnia):

{
	"Id": "1a0ae050ab3b21ce1e2e6e360a550352",
	"RememberIndexing": false,
	"PrimaryImageHeight": 250,
	"PrimaryImageWidth": 250,
	"CustomPrefs": {},
	"ScrollDirection": "Horizontal",
	"ShowBackdrop": true,
	"RememberSorting": false,
	"SortOrder": "Ascending"
}

In Visual Studio I see all of the properties:

image.png.d67667300c62314e9e1f005e4f75862a.png

The idea here is to set the ViewType property to "List" via PostDisplaypreferencesByDisplaypreferencesid.

This is where I'm getting stuck. There is no view type assigned even though it is currently Primary.
In addition, the client (required for the POST request) is null, so I figure either what I'm trying to achieve is not possible via the API, or I should be passing on something else as the folder id (if so what?!)

image.png.bf824ab499938e427fa57bf6764a0219.png

Any ideas where I'm going wrong?

Link to comment
Share on other sites

  • Solution

Hi.  The view type is saved per app/user and some of the apps don't use that API to do so - instead using cookie-type data.

  • Agree 1
Link to comment
Share on other sites

PlutoIsAPlanet
15 hours ago, ebr said:

Hi.  The view type is saved per app/user and some of the apps don't use that API to do so - instead using cookie-type data.

Thanks for the info @ebr

I saw the differences between a web browser and the android app (primary vs list on the same view for the same user).

So just to be clear, there's no way I can accomplish this via the API?
If so, is this something that might be allowed in the future by adding the user and app id's as query args?

Link to comment
Share on other sites

PlutoIsAPlanet
18 minutes ago, PlutoIsAPlanet said:

If so, is this something that might be allowed in the future by adding the user and app id's as query args?

My bad, I have just taken another look at the API.
You do allow the aforementioned as query args - sorry for the oversight.

The only question I have then, is how to retrieve the client (string) in order to pass that on?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...