client_add

This adds a Client of a certain type to a specific group. The type setting is workstation, password, clientname, or network.

Netsweeper recommends you use the format that best suits your requirements. If you want to expire a client 10 minutes from when the API call is run, you may want to use the +10 minutes. However, if you want the account to expire on a specific date at a specific time, using that exact date and time is recommended.

Concept Link IconSee Also  

Parameters:

Argument

Required

Type

Description

type

yes

String

The type setting is: workstation, password, clientname, or network.

clientname

yes

String

The name of the Client

groupname

yes

String

The groupname for the Client.

password

no

String

The password for the user. Required for password type.

ip

no

String

The ip for the Client. Required for workstation and network types

subnet

no

string

The subnet for the Client. Required for network type.

catlist

no

string

The Category list for the client. This can be a Category Number, Acronym, or the whole Category name. The whole Category names can contain special chars, such as space   or &. These chars must be encoded. For example Arts+%26+Culture must be used in api call for Arts & Culture.

ttl

no

date

·       now

·       +1 day

·       +10 months

·       -12 years

·       +1 week 2 days 4 hours 2 seconds

·       next wednesday

·       last monday

·       26 October 1998

·       @946684800 (specific EPOCH time)

·       19791013 (yyyymmdd)

·       1979/10/13 13:26:41 (yyyy/mm/dd hh:mm:ss)

·       1979/10/13 13:26:41 GMT (yyyy/mm/dd hh:mm:ss tz)

comment

no

string

Enter a comment.

workstation

no

string

Enter the Workstation name.

firstname

no

string

The first name of the Client.

lastname

no

string

The last name of the Client.

email

no

string

The email for the Client.

format

no

string

The format of the output for the API: text, json or xml. The default is text.

callback

no

string

This only works with Direct APIs. This is a JavaScript function that should be called after the API is completed. This function will be called with the response of the API.  Please note: It can only be used when requesting this API via AJAX request.

 

Example

servername/webadmin/api/client_add.php?type=VALUE&clientname=VALUE&groupname=VALUE

Output:

OK: Client created: clientname

ERROR: Required variable missing: type, clientname, groupname. Optional variables: password, ip, subnet, catlist, ttl, comment, workstation, firstname, lastname, email, format, callback

ERROR: The client name clientname already exists.

ERROR: IP Address and Subnet already used.

ERROR: Please specify a client name.

ERROR: Invalid client type 'sometype' specified.

ERROR: Group does not exist: groupname

ERROR: Your new password must be between 5 and 16 characters.

ERROR: The IP address you specified is not a valid address

ERROR: The IP address you entered is not a network address. Please specify a valid network address or change the subnet mask to 255.255.255.255

ERROR: The subnet mask you specified is not a valid subnet mask.

ERROR: Invalid Expiration Date

ERROR: List of categories is invalid

ERROR: Duplicate client name is only allowed in the same group. The client name clientname already exists in group groupname

ERROR: Permission denied: requires 'Add Clients' permission

ERROR: Permission denied: user useraccount requires permission for client type 'Authorized By Client Name'.

ERROR: Permission denied: user useraccount requires permission for client type 'Authorized By Password'.

ERROR: Permission denied: user useraccount is not a member of group groupname

ERROR: Permission Denied: Unauthorized access.

 

Netsweeper Version: 2.6.7