add an atributo to user object

This topic has 4 replies, 2 voices, and was last updated 4 years, 9 months ago by pryton.

  • Author
    Posts
  • #19932
     donetz_errasti
    Participant

    Hi,

    I would like to know how to add an attribute to a managed user objects. It should be via REST because I’m working with 2.1 version.

    Thanks

    #19949
     pryton
    Participant

    you need to do a PATCH

    #19954
     pryton
    Participant

    it could look like this

    curl -X PATCH –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘If-Match: *’ –header ‘X-Requested-With: Swagger-UI’ -d ‘[ \
    { \
    “operation”: “string”, \
    “field”: “string”, \
    “from”: “string”, \
    “value”: “string” \
    } \
    ]’ ‘http://localhost:8080/openidm/managed/user/4dcaeba0-e029-44ab-a9a0-7a6214ee681b’

    #19956
     donetz_errasti
    Participant

    Hi Pryton,
    I think it would be to change an user attribute that currently exists. But I want to create a new attribute for all users. And then, manage this attribute with a checkbox from the UI.
    So I think the curl will be different, but i’ve tried some requests and i’ve not achieve to create it.
    I would be awesome if you know how to do it. Thanks

    #19978
     pryton
    Participant

    If you want to add a attribute, then you can use add as operation

    curl -X PATCH –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘If-Match: *’ –header ‘X-Requested-With: Swagger-UI’ -d ‘[ \
    { \
    “operation”: “add”, \
    “field”: “string”, \
    “from”: “string”, \
    “value”: “string” \
    } \
    ]’ ‘http://localhost:8080/openidm/managed/user/4dcaeba0-e029-44ab-a9a0-7a6214ee681b’

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?