ProvisionUsers
ProvisionUsers is used to add a user. One user is added for each input item. If the specified user group or company does not exist, it will be created. The equivalent option in the dashboard is the Add user button on the Company or Users page.
Signature
Copy
ServiceResponse ProvisionUsers (CallingContext callingContext, ProvisionEntitiesInput input, outProvisionEntitiesResult result);
Data structure
The input to ProvisionUsers is an array of ProvisionEntitiesInput structures which contain the information on the user to be added. The device fields are not required.
Copy
[DataContract]
public class ProvisionEntitiesInput
{
public ProvisionEntitiesInput()
{
}
[DataMember]
public bool HaltOnProvisioningError;
[DataMember]
public bool ProceedOnValidationError;
[DataMember]
public bool ValidateOnly;
[DataMember]
public Guid PartnerId;
[DataMember]
public ProvisionElement[] ProvisionElements;
}
- HaltOnProvisioningError—When true, the method will stop after the first provisioning error. When false, the method will continue after the first provisioning error.
- ProceedOnValidationError—When true, the method will continue with provisioning even if initial validation fails. When false, the method will stop if initial validation fails.
- ValidateOnly—When true, only validation will be performed. No provisioning will be performed. When false, both validation and provisioning will be performed.
- PartnerId—Specify the ID of the partner the user should be assigned to. If you do not specify a partner ID, the partner ID associated with the CallingContext user will be used.
- ProvisionElements—Specify the elements for the user to be added.
Copy
[DataContract]
public class ProvisionElement
{
[DataMember]
public int Id;
[DataMember]
public ProvisioningStatus Status;
[DataMember]
public string Info;
[DataMember]
public EntityState UserState;
[DataMember]
public string Email;
[DataMember]
public string FirstName;
[DataMember]
public string LastName;
[DataMember]
public string UserCustom1;
[DataMember]
public string UserCustom2;
[DataMember]
public string UserCustom3;
[DataMember]
public EntityState UserGroupState;
[DataMember]
public string UserGroup;
[DataMember]
public EntityState CompanyState;
[DataMember]
public string CompanyName;
[DataMember]
public EntityState DeviceState;
[DataMember]
public string DeviceName;
[DataMember]
public string DeviceId;
[DataMember]
public string PolicyName;
[DataMember]
public int CurrentStorageGB;
[DataMember]
public string DeviceCustom1;
[DataMember]
public string DeviceCustom2;
[DataMember]
public string DeviceCustom3;
[DataMember]
public bool SendActivationEmail;
[DataMember]
public string ActivationCode;
}
- Id—Do not use this field. It is used for the row number when bulk importing using Microsoft Excel.
- Status—Do not use this field. It is an output property that identifies the status of the new user.
- Info—Do not use this field. It is an output property that identifies the comments for the new user.
- UserState—Do not use this field. It is an output property that identifies the status of the new or modified user.
- * Email—Specify the email address of the user. If the email address does not exist, the user will be added. If the email address already exists, the associated user will be used. This property is required.
- FirstName—Specify the first name of the user. Pass null if you do not want to change the field. An empty string will leave the field blank.
- LastName—Specify the last name of the user. Pass null if you do not want to change the field. An empty string will leave the field blank.
- Custom—Optionally, specify any of the three properties for storing custom strings for the user. Pass null if you do not want to change the field. An empty string will leave the field blank.
- UserGroupState—Do not use this field. It is an output property that identifies if the user group already exists.
- * UserGroup—Specify the user group the device should be assigned to. This property is required, however, an empty string will assign the device to the All Uses group.
- CompanyState—Do not use this field. It is an output property that identifies if the company already exists.
- * CompanyName—Specify the company the device should be assigned to. This property is required, however, an empty string will assign the device to the Unknown company.
- DeviceState—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- DeviceName—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- DeviceId—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- PolicyName—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- CurrentStorageGB—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- DeviceCustom—Do not use this field when adding a user. If you need to add a device and user together, see ProvisionEntities.
- * SendActivationEmail—When true, an activation message will be sent to the specified email address. When false, the activation email will not be sent.
- ActivationCode—Do not use this field. It is an output property that identifies the activation code for the device.
* These properties are required.
Result
In addition to the BaseServiceResult described in General API structure, ProvisionUsersResult is an array of ProvisionElements as described above.
Copy
[DataContract]
public class ProvisionUsersResult : BaseServiceResult
{
public ProvisionElements[] Element;
{
}
}