Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

You can create, read, and update the user information using the User Manager node.

For example, using this node you can create/update a user in orbita, or you can impersonate a user.

The User Manager supports three action types:

  • Read. Query data based on the query defined in the payload

  • Create. Create a new user record based on the payload

  • Update. Update an existing user record based on the payload

Payload

The Payload is a JSON query. See examples in this topic regarding how to construct query params/payload data.

Output

The output from this node is available at msg.data.userData

Read

Getting user information by the logged-in user-id

{ "_id": "{{msg.payload.session.user.currentUserId}}"}

Getting user information by a custom user property

{ "personaProfile.deviceid": "{{msg.deviceId}}" }

Get orbita user information using firstname

{ "firstName" : "john"}

Create

You can create a new record using this option.

{ 
    "firstName" : "John",
    "lastName" : "Smith",
    "username" : "jsmith@orbita.ai",
    "provider" : "local",
    "password" : "test",
    "suspended": false,
    "roles": ["admin"],
    "personaProfile": {"title": "CEO", "email": "jsmith@orbita.ai"},
    "avatarSrc": "img/avatar0.jpg",
    "personaType": "58c1733b838fc9bb55ed0828"
}

"username" should be a valid email Id.
"provider" is an Optional parameter.
"suspended" is an Optional parameter.
"roles" is an Optional parameter.
"avatarSrc" is an Optional field.
personaType” can be an ID or a name. For example, "personaType": "58c0587dc01db80f0019163c" or
"personaType": "Administrators".

If you don't specify personaType while creating a user using the User Manager node, the user will be created under the “User“ persona type.

Update

You can update an existing record with this option

Example 1

Updating the first name.

{ 
  "data":{ 
    "firstName" : "Johnny" 
  }, 
  "_id": "58eb67b56e0973476d240425" 
}

Example 2

Updating the persona profile.

{ 
  "data": {
    "personaProfile" : {
      "title": "CEO - CoFounder"
    }
  }, 
  "_id": "58eb67b56e0973476d240425" 
}

Related Articles

  • No labels