workfront-api

Setting User Preferences (USERPF) Via the API


I have a script that performs automatic account setup. As part of that setup I would like to manage certain user preferences such as notification settings and percent bar shown in updates. The USER object has a collection for userPrefValues. To run initial tests on this I pulled the userPrefValues from an existing user, change the userID field value and tried to use this to replace the preferences on another user. The call appears to go through, it returns a user object. but no user values are updated.

My next thought was that I could identify and update individual preference values directly in the USERPF table. Interestingly the items in this table have no ID. Without an ID there is no ability to use PUT to make an update.

Does anyone know how to update user preferences via the API?


Solution

  • You're on the right track by trying to modify the USERPF object directly, and you're correct in that you cannot update an existing preference since they lack IDs. What you must do is create a new USERPF object, which will override the old one.

    For example, to enable the 'Automatically generate proofs when uploading documents' checkbox for a specific user, I'd call the following:

    POST https://<url>.my.workfront.com/attask/api/v7.0/userpf?name=marketingsolutions.proofing.autogenerate&value=true&userID=<UUID>&apiKey=<key>
    

    Enjoy the challenge of finding the specific preference name. They are...not well named.