Forum Discussion

liaodm's avatar
liaodm
Contributor
11 years ago

API objects for properties not available via User/Profiles?

I am currently working on a custom component that will replace Lithium's stock 'MyProfilePage' (which reloads the page to display various tab states) with a single-page JavaScript application that talks to a custom endpoint.

 

In tracing out the property names on the User/profiles API, I have found several properties that don't appear in any API docs:

 

Preferences
    Options
?        Time zone
?        Ignore HTML
?        Use the Rich Text Editor
?        Show confirmation pages

    Private Messenger
?        No. of private messages per page

    Moderator
?        Show Moderator Flag column
?        Clear moderation flag automatically

Notifications
    Notifications
        Email Notifications - Notify me of:
?            Posts I'm @mentioned in
?            Accepted solutions to topics or questions I subscribe to

Looking at the markup for the form fields provides some clues.  In "MyProfilePage" the fieldnames associated with User/profiles are prefixed with "profile" such as "profilelanguage_*" and "profileshow_user_signatures_*".  The undocumented fields I'm interested in are prefixed differently, such as "configtimezone_*" and "layoutignore_html_*". 

 

Queries to restapi/vc/users/id/${user.id}/config and restapi/vc/users/id/${user.id}/layout do not work.  Are the Config and Layout objects exposed via some other API Node that I don't know about?

  • Hey liaodm,

     

    I think the items you are looking for can be found using the Settings API.

     

    The particular ones you are looking for can be looked up using the following:

     

    restapi/vc/users/id/<id>/settings/name/config.timezone

     

    restapi/vc/users/id/<id>/settings/name/layout.ignore

     Hope this helps,

     

    Yuri

3 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    11 years ago

    Hey liaodm,

     

    I think the items you are looking for can be found using the Settings API.

     

    The particular ones you are looking for can be looked up using the following:

     

    restapi/vc/users/id/<id>/settings/name/config.timezone

     

    restapi/vc/users/id/<id>/settings/name/layout.ignore

     Hope this helps,

     

    Yuri

  • liaodm's avatar
    liaodm
    Contributor
    11 years ago

    Hi YuriK,

     

    Thanks for the reply.  Yes, this will help.  Perhaps Lithium would consider listing the available properties on User/Profiles and User/Settings in the API documentation?

     

    D.

  • YuriK's avatar
    YuriK
    Khoros Expert
    11 years ago

    Hey liaodm,

     

    I agree that we should probably document the superset of profile and settings fields. Can you please add an idea to the Idea Board to add some visibility to this?

     

    Also, one thing that I do to see all the settings and profiles is make a call to the collections as an admin with a large page size to see all the ones that are available. Then you can page through the results using ?page=<page_number>

     

    /restapi/vc/users/id/<id>/profiles?page_size=1000
    /restapi/vc/users/id/<id>/settings?page_size=1000

    It definitely would still be nice to have descriptions of each setting/profile setting though. 

     

    Hope this helps,

     

    Yuri