Forum Discussion

iahiqosolutions's avatar
13 years ago

REST API: Add custom setting to User entity

Hi there!

 

I have question concering the Lithium REST API.

I want to add custom setting to the user entity(gender of the current user).

I tried to use the following method:

/restapi/vc/authentication/sessions/current/user/settings/name/profile.gender/set

But I'm always getting the error with code #303.

 

Error code: 303. User[id=49, loginRef=Georg McMurfy, emailRef=hpb13448@msb.minsmail.com, registrationTime=1346411976379, deletedRef=false, rankingId=-1, lastVisitTime=1346411976379, isLegacy=true, isPartiallyRegistered=false, registrationCompletedTime=0, isAnonymous=false, roleInfoRef=UserRoleInfo[roles=[]], ranking=Ranking [rankId=-1, sortOrder=100, rankName=N/A, rankBold=false, rankColor=, rankIcon=, rankIconRight=, rankIconThread=, grantRoles=, removeRoles=, kudosWeight=-1, registrationAge=0, metricPosts=0, metricPageViews=0, metricLogins=0, metricMinutesOnline=0, metricTags=0, averageMessageRating=0, equalsUserId=-1, equalsRole=, equalsRoleKey=null, rankingFormula=, rankingFormulaEnabled=false, coreNode=CoreNode(class lithium.boards.core.Community)[SQLCoreNodeinfo: owner=-1 metricsId=1 hidden=false hiddenAncestor=false deleted=false nodeId=1 parentNodeId=-1 type=DaoNodeTypeRef[nodeTypeUid=1] displayId='napaonline' path=NodePath:/, depth:1], rankTextMsg=LocalizedMessageDescriptor[messageLocator=FallbackSequenceMessageLocator[textKeyIterable=[TextKey[rank.-1.title]]],messageArgs={}]]] cannot set field 'profile.gender' on object User[id=49, loginRef=Georg McMurfy, emailRef=hpb13448@msb.minsmail.com, registrationTime=1346411976379, deletedRef=false, rankingId=-1, lastVisitTime=1346411976379, isLegacy=true, isPartiallyRegistered=false, registrationCompletedTime=0, isAnonymous=false, roleInfoRef=UserRoleInfo[roles=[]], ranking=Ranking [rankId=-1, sortOrder=100, rankName=N/A, rankBold=false, rankColor=, rankIcon=, rankIconRight=, rankIconThread=, grantRoles=, removeRoles=, kudosWeight=-1, registrationAge=0, metricPosts=0, metricPageViews=0, metricLogins=0, metricMinutesOnline=0, metricTags=0, averageMessageRating=0, equalsUserId=-1, equalsRole=, equalsRoleKey=null, rankingFormula=, rankingFormulaEnabled=false, coreNode=CoreNode(class lithium.boards.core.Community)[SQLCoreNodeinfo: owner=-1 metricsId=1 hidden=false hiddenAncestor=false deleted=false nodeId=1 parentNodeId=-1 type=DaoNodeTypeRef[nodeTypeUid=1] displayId='napaonline' path=NodePath:/, depth:1], rankTextMsg=LocalizedMessageDescriptor[messageLocator=FallbackSequenceMessageLocator[textKeyIterable=[TextKey[rank.-1.title]]],messageArgs={}]]]

 

Could anybody explain me, what does it mean?

 

P.S.

I used session key of the user with administration permissions.

 

 

 

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Has the custom setting already been configured by Lithium? If not, I would suggest filing a case via our Customer Case Portal so that our Support team can assist you with the next steps of having a new custom setting added to your community.

    • Hello Adam,

       

      Where can I configure custom setting? (NOTE: I can change other custom settings like 'name_first')

      Should I create case for the Lithium support team every time if I want to add setting with not wel-known name?(In my case "profile.gender")

       

       

      • AdamN's avatar
        AdamN
        Khoros Oracle

        Hello,

         

        Indeed, you will need to create a case to have custom settings configured. Adding a new custom setting requires modification of files that are not currently available in Lithium Studio, so Lithium will have to make those changes on your behalf.