CreateUsers

 

UserService / CreateUsers

 

Description: Create user

URL: http://{your-server-url}/api/v1/core/users

Method: POST

Token Required: True


Request Headers:
currentaccountid: {accountid - optional and default value is user's own account}
content-type: application/json or content-type: application/xml
token: {token}
Required Roles:

Portal Administrator, Account Administrator, Account Owner, Network Administrator

Rights:

Type: Nexus.AppSpace.Service.Contract.Model.Enums.Rights.Rights

Right Require Comment
Basic Yes
Network_Management Optional Required if create user with network id that different with current user's home network

Request:

Type: Nexus.AppSpace.Service.Contract.Messages.AppSpaceIntegration.v1.User.UserRequest

Parameter Type Nullable
Request.Users Nexus.AppSpace.Service.Contract.Model.DTO.AppSpaceIntegration.v1.Users.User[] False

Response:

Type: Nexus.AppSpace.Service.Contract.Messages.AppSpaceIntegration.v1.User.UserResponse

Parameter Type
Response.Users Nexus.AppSpace.Service.Contract.Model.DTO.AppSpaceIntegration.v1.Users.User[]

Enums:
Field Name Values
Status Nexus.AppSpace.Service.Contract.Model.Enums.User.Status Disabled = 0, Active = 1, Locked = 2, Undefined = -1

The following is an example request Xml body:
<UserRequest xmlns="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Messages.AppSpaceIntegration.v1.User" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Users xmlns:a="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Model.DTO.AppSpaceIntegration.v1.Users">
    <a:User>
      <a:AccountId>123</a:AccountId>
      <a:CloudGuid>String</a:CloudGuid>
      <a:Email>String</a:Email>
      <a:FirstName>String</a:FirstName>
      <a:GroupId>123</a:GroupId>
      <a:HomeNetworkId>123</a:HomeNetworkId>
      <a:Lastname>String</a:Lastname>
      <a:MobileNo>String</a:MobileNo>
      <a:Password>String</a:Password>
      <a:RoleIds xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <b:int>123</b:int>
      </a:RoleIds>
      <a:SecretAnswer>String</a:SecretAnswer>
      <a:SecretQuestion>String</a:SecretQuestion>
      <a:Status>Locked</a:Status>
      <a:UserDN>String</a:UserDN>
      <a:Username>String</a:Username>
      <a:WorkNo>String</a:WorkNo>
    </a:User>
  </Users>
</UserRequest>

The following is an example request Json body:
{
	"Users":[
		{
			"AccountId":123,
			"CloudGuid":"String",
			"Email":"String",
			"FirstName":"String",
			"GroupId":123,
			"HomeNetworkId":123,
			"Lastname":"String",
			"MobileNo":"String",
			"Password":"String",
			"RoleIds":[
				123
			],
			"SecretAnswer":"String",
			"SecretQuestion":"String",
			"Status":2,
			"UserDN":"String",
			"Username":"String",
			"WorkNo":"String"
		}
	]
}

The following is an example response Xml body:
<UserResponse xmlns="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Messages.AppSpaceIntegration.v1.User" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <DebugMessage xmlns="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Messages">String</DebugMessage>
  <Errors xmlns="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Messages">
    <Error>
      <Code>String</Code>
      <Message>String</Message>
      <StackTrace>String</StackTrace>
    </Error>
  </Errors>
  <Status xmlns="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Messages">Success</Status>
  <Users xmlns:a="http://schemas.datacontract.org/2004/07/Nexus.AppSpace.Service.Contract.Model.DTO.AppSpaceIntegration.v1.Users">
    <a:User>
      <a:AccountId>123</a:AccountId>
      <a:CloudGuid>String</a:CloudGuid>
      <a:CreatedDate>2014-12-15T15:18:54.3065035Z</a:CreatedDate>
      <a:Email>String</a:Email>
      <a:EntitlementIds xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <b:int>123</b:int>
      </a:EntitlementIds>
      <a:FirstName>String</a:FirstName>
      <a:GroupId>123</a:GroupId>
      <a:Id>123</a:Id>
      <a:LastAccess>2014-12-15T15:18:54.3065035Z</a:LastAccess>
      <a:Lastname>String</a:Lastname>
      <a:MobileNo>String</a:MobileNo>
      <a:RoleIds xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <b:int>123</b:int>
      </a:RoleIds>
      <a:Status>Locked</a:Status>
      <a:UserDN>String</a:UserDN>
      <a:Username>String</a:Username>
      <a:WorkNo>String</a:WorkNo>
    </a:User>
  </Users>
</UserResponse>

The following is an example response Json body:
{
	"DebugMessage":"String",
	"Errors":[
		{
			"Code":"String",
			"Message":"String",
			"StackTrace":"String"
		}
	],
	"Status":1,
	"Users":[
		{
			"AccountId":123,
			"CloudGuid":"String",
			"CreatedDate":"\/Date(1418656734306)\/",
			"Email":"String",
			"EntitlementIds":[
				123
			],
			"FirstName":"String",
			"GroupId":123,
			"Id":123,
			"LastAccess":"\/Date(1418656734306)\/",
			"Lastname":"String",
			"MobileNo":"String",
			"RoleIds":[
				123
			],
			"Status":2,
			"UserDN":"String",
			"Username":"String",
			"WorkNo":"String"
		}
	]
}