Thread
#getting-started
    s

    some-crayon-90964

    1 year ago
    Which piece of code should I be looking at if I want to implement new API or change existing API to add new users?
    CorpUserViewDao
    seems to have all sorts of getting methods, but I am having hard time finding methods to create new user. Thanks in advanced!
    a

    acceptable-architect-70237

    1 year ago
    backend or frontend. I think it's best to integrate with LDAP if you want to add a new user
    b

    bumpy-keyboard-50565

    1 year ago
    Could you elaborate the sort of "changes" you intend to do to the API? It'll help us guide you in the right direction.
    s

    some-crayon-90964

    1 year ago
    @bumpy-keyboard-50565 @acceptable-architect-70237 I think I have get it done. I created a method in
    CorpUsers
    to use a
    CorpUsersDoIngestRequestBuilder
    to send a insert user request like other methods do.
    Thanks for the help from both of you
    a

    acceptable-architect-70237

    1 year ago
    hope I understood your intention correctly. If you want to create a new user, the user creation API is there, and you can do it in the following way
    curl '<http://localhost:8080/corpUsers?action=ingest>' -X POST -H 'X-RestLi-Protocol-Version:2.0.0' --data '{"snapshot": {"aspects": [{"com.linkedin.identity.CorpUserInfo":{"active": true, "displayName": "Foo Bar", "fullName": "Foo Bar", "email": "<mailto:fbar@linkedin.com|fbar@linkedin.com>"}}, {"com.linkedin.identity.CorpUserEditableInfo":{}}], "urn": "urn:li:corpuser:fbar"}}'
    s

    some-crayon-90964

    1 year ago
    What im trying to do is have one of API to be able to create new user. I dont like to have 1 API calls another API internally, so I am looking for a way that is intuitive (from class to class)
    a

    acceptable-architect-70237

    1 year ago
    for what it worths, datahub has been designed in this way for a good reason. Which is Metadata Audit event coming to the picture. When you create it an entity, datahub will decide whether it is new so they will persist, or if it's not new but with aspect updated, it will bump a new version. it is not new at all, it will not persist.