Forum Discussion

srinivaskiranp's avatar
7 years ago

how can i retrieve Specific Category properties.

category properties

In the above picture how can i retrieve "Hide from lists and menus" property for category archive.

regards

Srinivas Kiran 

  • luk's avatar
    luk
    7 years ago

    srinivaskiranp You can get it either trough API v1 or v2:

    v1 with something like

    <#assign hidden = restadmin("categories/id/<categoryid>/settings/name/config.hidden").value />

    v2 with something like:

    <#assign query = "SELECT hidden FROM categories WHERE id = '<categoryid>'"?url />
    <#assign hidden = restadmin("2.0", "/search?q=${query}").data.items[0].hidden />

    note that you need to set off these requests with admin permissions...

8 Replies

  • srinivaskiranp's avatar
    srinivaskiranp
    Guide
    7 years ago

    Hi 

    "Hide from lists and menus"  is a custom property which is mention in my initial post. 

  • rpanda2007's avatar
    rpanda2007
    Guide
    7 years ago
    You can get it by going to Admin > community Structure and navigate to the category you want to get the property.

    Keep your mouse on top of that and you will see an option called edit properties.

    After clicking that you will see the options.

    ##- Please type your reply above
  • luk's avatar
    luk
    Boss
    7 years ago

    srinivaskiranp You can get it either trough API v1 or v2:

    v1 with something like

    <#assign hidden = restadmin("categories/id/<categoryid>/settings/name/config.hidden").value />

    v2 with something like:

    <#assign query = "SELECT hidden FROM categories WHERE id = '<categoryid>'"?url />
    <#assign hidden = restadmin("2.0", "/search?q=${query}").data.items[0].hidden />

    note that you need to set off these requests with admin permissions...

  • luk 

    can you help how to solve the below issue. 

     I tried to use the below url to get the session key for querying Community API V1 calls in community through postman, but i am getting an error response as below.

    Need inputs to resolve the  problem.

    GET request : http://community.lithium.com/restapi/vc/authentication/sessions/login?user.login=[USER NAME]&user.password=[PASSWORD]

    error response :

    <response status="error">
    <error code="504">
    <message>
    Method &apos;get&apos; is not supported off of node &apos;authentication_manager.sessions.login&apos;.
    </message>
    </error>
    </response>

    Note:  I got a solution for this, but it is a post request. I need to get the response for GET request.

  • luk's avatar
    luk
    Boss
    7 years ago

    srinivaskiranp Not really, I try to avoid doing authentication related stuff where the password is passed in a GET parameter =)... I know, HTTPS and stuff, but looks like that transferred over from a time when not everybody could have free SSL certificates...

    so what I do is create endpoints that will execute the necessary queries for me and return the result...but I guess there were multiple posts about such stuff in the past on Lithosphere, no?

    EDIT: do you url-encode the values of username and password? If not, that might be an issue...