Accounting

This service provides methods that create, change or delete Users, Accounts and Groups.  Most functionality provided here is also available using the Webview Interface.

Please note that the fallback location does not offer all Accounting methods, see Implementing fallback for more information.

Summary
This service provides methods that create, change or delete Users, Accounts and Groups.
These methods allow Webservices.nl partners to have their customers use our services, without having to handle account administration or registration of costs.
Retrieve a token with which a new account may be registered via the Webview Interface by one of your customers.
Get the id of an account created with a token from accountGetCreationToken.
Retrieve a token that can be used order account balance via the Webview Interface.
Remove all or one User::Session of a User.
Lists all the current valid User::Sessions of a User.
Returns the users balance.
Change the user’s balance.
Returns the accounts balance
View the profile of a user.
Edit the profile of a user.
Edit the complete profile of a user.
Create a user, assign it to groups and send it an activation mail.
Change the current password of a user.
Remove the user.
Send a notification email to a user with a new password.
List all groups that the current user can assign to the target user.
Add a user to a group.
Remove a user from a group.
View the profile of an account.
Edit the properties (AccountV2) of an account.
List all users in this account.
Search for users of an account using a search phrase.
Set host restrictions for the account
View host restrictions for the account
Set host restrictions for the user
View host restrictions for the user
This method is deprecated, use userCreateV2 instead
This method is deprecated, use userViewV2 instead
This method is deprecated and will be removed, use userViewBalance instead
This method is deprecated, use accountViewV2 instead
Returns the number of credits a account has assigned.
This method is deprecated and will be removed.
add any complex types used by soap functions in this class
A User Group entry.
A User entry.
A UserCredentials entry.
A UserV2 entry.
An Account entry.
An AccountV2 entry.
A session entry.
A token for creating a new account via the Webview Interface.
A token for order account balance via the Webview Interface.

Partner customer registration

These methods allow Webservices.nl partners to have their customers use our services, without having to handle account administration or registration of costs.  The customer registers his own account via our Webview Interface.  As a partner you can set the credentials for this Account, enabling you to use the account within your application, on behalve of the customer.

In short

  • Your customer registers himself on our platform and pays for his own account.
  • Your application stores the account details for the customer’s Webservices.nl account, such as usernames and passwords.
  • Our services become available to your application through the customer’s account.

Setting up a new customer account

In order to set up the customer’s account correctly, a number of steps are required.  Step-by-step customer account setup:

1A customer within your application needs to use our services, but doesn’t have a Webservices.nl account yet.  Your application calls accountGetCreationToken to get a registration URL and a token.  The token must be stored with the customer data in your application.
2The customer is directed to our Webview Interface using the registration URL retrieved in the previous step.
3A Webservices.nl account is registered and paid for by the customer.  It is automatically associated with your partner account (the one used to call accountGetCreationToken).
4Via a call to accountGetCreationStatus, the identifier of the new account is retrieved by your application.
5Now that the new customer’s account identifier is known, your application can generate passwords for the account, and assign them using the accountUserListV2 and userChangePassword methods.  Two Users are created for all accounts.  Only one has access to our data services (‘customername_User’), the other is intended for the administration of the account.  The customer’s account can now be used to call the webservices from your application.
6When the customer is close to running out of balance on his Webservices.nl account (see accountViewBalance), use accountGetOrderToken to retrieve a token for accessing the order page in the Webview Interface.

accountGetCreationToken

Retrieve a token with which a new account may be registered via the Webview Interface by one of your customers.  The newly created account will be associated with your account.  Tokens are only valid for a limited amount of time.  Use accountGetCreationStatus to get the id of the account created using the token.

Parameters

return_urlThis is the URL to which the customer is redirected after registering a Webservices.nl account.  If a customer arrives at this URL the accountGetCreationStatus should be called to check if account creation was successful.

Returns

An AccountCreationToken

accountGetCreationStatus

Get the id of an account created with a token from accountGetCreationToken.

Depending on the outcome of the account registration the following is returned

A value larger than 0The customer has successfully registered an account.  The returned value is the account id of the new account.
A value of 0The customer has not yet finished the account registration process.  It may be that Webservices.nl is awaiting confirmation of a payment performed by the customer.  You should not retrieve a new account registration token, or direct the customer to the account registration page again.  This could result in the customer registering and paying for an account that is never used.  Instead, try calling accountGetCreationStatus again later.
A ‘Server.Data.NotFound’ errorThis error indicates that the registration process was unsuccessful.  See Error Handling::Error codes.  You may start the registration process over by calling accountGetCreationToken.

Parameters

tokenA token retrieved using accountGetCreationToken

Returns

The account id, which is 0 when the account registration has not finished yet

accountGetOrderToken

Retrieve a token that can be used order account balance via the Webview Interface.

Parameters

accountidThe id of the account for which balance will be ordered
return_urlThis is the URL to which the customer is redirected after finishing the order process.

Returns

An AccountOrderToken

Session related methods

userSessionRemove

Remove all or one User::Session of a User.

Parameters

useridUser ID of the user to view, use 0 for the current user
reactidSession ID to remove, use 0 to remove all sessions

Returns

Nothing

See also

Authentication::logout

userSessionList

Lists all the current valid User::Sessions of a User.

Parameters

useridUser ID of the user to view, use 0 for the current user
pagePage to retrieve, pages start counting at 1

Returns

outA Patterns::{Type}PagedResult of Session entries.

Balance related methods

userViewBalance

Returns the users balance.

If the user is in the ‘autoassign’ user group, he is not restricted by his balance.  In that case, he can still do method calls even though his balance amount is zero.  If the user is not in the ‘autoassign’ user group, the user can spend his own balance amount, but not more.

Parameters

useridUser ID of the user to view the balance of, use 0 for the current user

Returns

balanceThe users balance

See also

accountViewBalance, Balance

userEditBalance

Change the user’s balance.

Parameters

useridUser ID of the user to edit the balance of, use 0 for the current user
balanceAmount of balance to add to (or remove from, if negative) the user

Returns

Nothing

See also

userViewBalance

accountViewBalance

Returns the accounts balance

Parameters

accountidAccount ID of the account to view the balance of, use 0 for the current account

Returns

balanceThe accounts balance

See also

Balance

User related methods

userViewV2

View the profile of a user.

Parameters

useridUser ID of the user to view, use 0 for the current user

Returns

outA UserV2 structure

userEditV2

Edit the profile of a user.  This method allows Group::Account users to edit their own profile.  Group::Account admins can use userEditExtendedV2 to change the complete profile.

Parameters

useridUser ID of the user to edit, use 0 for the current user.
emailRegistration email address, used for activation.
addressAddress of the company using this user.
contactnameName of the contact person responsible for this user.
contactemailThis field is not used and is ignored by the method.
telephoneTelephone number of the contact person responsible for this user.
faxFax number of the contact person responsible for this user.
passwordThe current password for this user.

Returns

Nothing

See also

userEditExtendedV2

userEditExtendedV2

Edit the complete profile of a user.  This method is only available to Group::Account adminsGroup::Account users can use userEditV2 to change some part of the profile.

Parameters

useridUser ID of the user to edit, use 0 for the current user
nicknameNickname to use for this user.  All users get a prefix set by Account::Username prefix.
passwordThe new password for this user.  To keep the current password pass the empty string.
emailRegistration email address, used for activation.
companynameName of the company using this user, if any.
addressAddress of the company using this user, if any.
contactnameName of the contact person responsible for this user.
contactemailThis field is not used and is ignored by the method.
telephoneTelephone number of the contact person responsible for this user.
faxFax number of the contact person responsible for this user.
clientcodeDeprecated, should contain an empty string.
commentsComments on the user, can only be seen and edited by Group::Account admins.
accountidthe Account ID to assign this user to, use 0 for the current account.  Only usable by Group::Admins
balancethresholdBalance threshold to alert user, 0 to disable.
notificationrecipientsRecipients of balance alert notification:” ‘-- accountcontact’ = contact account contact ‘-- user’ = contact user ‘-- accountcontact_and_user’ = both Returns: Nothing

See also

userEditV2, userChangePassword

userCreateV2

Create a user, assign it to groups and send it an activation mail.

Parameters

accountidthe Account ID to assign this user to.
nicknameNickname to use for this user, leave empty to to create a random nickname.  All users get a prefix set by Account::Username prefix.
passwordPassword to use for authentication, leave empty for a strong random password.
usergroupsarray of user group IDs to assign this user to. see userListAssignableGroups for a list.
emailRegistration email address, used for activation.
companynameName of the company using this user, if any.
addressAddress of the company using this user, if any.
contactnameName of the contact person responsible for this user.
contactemailThis field is not used and is ignored by the method.
telephoneTelephone number of the contact person responsible for this user.
faxFax number of the contact person responsible for this user.
clientcodeDeprecated, should contain an empty string.
commentsComments on the user, can only be seen and edited by Group::Account admins.

Returns

idUser ID of the newly created user.
nicknameNickname of the newly created user.
passwordPassword of the newly created user.  Together with the activation email, this is the only time the password is plainly visible.

userChangePassword

Change the current password of a user.  A Group::Account users has to give the old password for authentication, Group::Account admins do not have to.

Parameters

useridUser ID of the user to edit, use 0 for the current user
old_passwordThe old password, not required for Group::Account admins
new_passwordThe new password.

Returns

Nothing

See also

userNotify

userRemove

Remove the user.  This method is only available to Group::Account admins.

Parameters

useridUser ID of the user to remove, use 0 for the current user

Returns

Nothing

userNotify

Send a notification email to a user with a new password.  This method is part of the User::Creation process.

Parameters

useridUser ID of the user to notify, use 0 for the current user
passwordPassword to use for authentication, leave empty for a strong random password.

Returns

outPassword of the user.  Together with the activation email, this is the only time the password is plainly visible.

Group related methods

userListAssignableGroups

List all groups that the current user can assign to the target user.  This list contains both assigned and unassigned groups.

Parameters

useridUser ID of the user to target, use 0 for the current user
pagePage to retrieve, pages start counting at 1

Returns

outA Patterns::{Type}PagedResult of User entries.

See also

userAddGroup, userRemoveGroup

userAddGroup

Add a user to a group.  A user can use userListAssignableGroups to view the groups that can be assigned.

Parameters

useridUser ID of the user to add to the group, use 0 for the current user
usergroupidUser Group ID of the group to add the user to

Returns

Nothing

See also

userListAssignableGroups, userRemoveGroup

userRemoveGroup

Remove a user from a group.  A user can use userViewV2 to view the groups that are currently assigned to the user.

Parameters

useridUser ID of the user to remove from the group, use 0 for the current user
usergroupidUser Group ID of the group to remove the user from

Returns

Nothing

See also

userViewV2, userAddGroup, userListAssignableGroups

Account related methods

accountViewV2

View the profile of an account.

Parameters

accountidAccount ID of the account to move use 0 for the account of the current user

Returns

outA AccountV2 structure

accountEditV2

Edit the properties (AccountV2) of an account.  This method allows Group::Account admins to edit their account profile.

Parameters

accountidAccount ID of the account to edit, use 0 for the current user’s account
addressAddress of the company using this account.
contactnameName of the contact person responsible for this account.
contactemailEmail address of the contact person responsible for this account.
telephoneTelephone number of the contact person responsible for this account.
faxFax number of the contact person responsible for this account.
descriptionDescription of the account to its users.
balancethresholdBalance threshold to alert account, use 0 to disable.

Returns

Nothing

accountUserListV2

List all users in this account.  This method is only available to Group::Account admins.

Parameters

accountidAccount ID of the account to list, use 0 for the current user’s account
pagePage to retrieve, pages start counting at 1

Returns

outA Patterns::{Type}PagedResult of UserV2 entries.

accountUserSearchV2

Search for users of an account using a search phrase.  This method is only available to Group::Account admins.

Parameters

accountidAccount ID of the account to list, use 0 for the current user’s account
phrasePhrase to search for in user profiles
pagePage to retrieve, pages start counting at 1

Returns

outA Patterns::{Type}PagedResult of UserV2 entries.

Host restriction methods

accountEditHostRestrictions

Set host restrictions for the account

Parameters

accountidAccount ID of the account, use 0 for the current user’s account
restrictionsA string with host restrictions separated by semi colons (;)

Returns

Nothing

See also

userEditHostRestrictions, accountViewHostRestrictions

accountViewHostRestrictions

View host restrictions for the account

Parameters

accountidAccount ID of the account, use 0 for the current user’s account

Returns

A string containing all restrictions, separated by semi colons

See also

userViewHostRestrictions, accountEditHostRestrictions

userEditHostRestrictions

Set host restrictions for the user

Parameters

useridUser ID of the user, use 0 for the current user
restrictionsA string with host restrictions separated by semi colons (;)

Returns

Nothing

See also

accountEditHostRestrictions, userViewHostRestrictions

userViewHostRestrictions

View host restrictions for the user

Parameters

useridUser ID of the user, use 0 for the current user

Returns

A string containing all restrictions, separated by semi colons

See also

accountViewHostRestrictions, userEditHostRestrictions

Deprecated accounting methods

userCreateAuto

Notice

This method is deprecated, use userCreateV2 instead

Create a user, assign it to groups and credits, and send it an activation mail.

Parameters

accountidthe Account ID to assign this user to.
nicknameNickname to use for this user, leave empty to to create a random nickname.  All users get a prefix set by Account::Username prefix.
passwordPassword to use for authentication, leave empty for a strong random password.
creditsnumber of credits to move to this user from the account.
usergroupsarray of user group IDs to assign this user to. see userListAssignableGroups for a list.
emailRegistration email address, used for activation.
companynameName of the company using this user, if any.
addressAddress of the company using this user, if any.
contactnameName of the contact person responsible for this user.
contactemailThis field is not used and is ignored by the method.
telephoneTelephone number of the contact person responsible for this user.
faxFax number of the contact person responsible for this user.
clientcodeDeprecated, should contain an empty string.
commentsComments on the user, can only be seen and edited by Group::Account admins.

Returns

idUser ID of the newly created user.
nicknameNickname of the newly created user.
passwordPassword of the newly created user.  Together with the activation email, this is the only time the password is plainly visible.

userView

Notice

This method is deprecated, use userViewV2 instead

View the profile of a user.

Parameters

useridUser ID of the user to view, use 0 for the current user

Returns

outA User structure

userViewCredits

Notice

This method is deprecated and will be removed, use userViewBalance instead

Returns the number of credits a user has assigned.

Parameters

useridUser ID of the user to view the credits of, use 0 for the current user

Returns

creditsThe number of credits currently assigned to the user

accountView

Notice

This method is deprecated, use accountViewV2 instead

View the profile of an account.

Parameters

accountidAccount ID of the account to move, use 0 for the account of the current user

Returns

outA Account structure

accountViewCredits

Returns the number of credits a account has assigned.

Notice

This method is deprecated and will be removed, use accountViewBalance instead

Parameters

accountidAccount ID of the account to view, use 0 for the account of the current user

Returns

outThe number of credits currently assigned to the account

accountUsesBalance

Notice

This method is deprecated and will be removed.

Parameters

accountidIgnored

Returns

outAlways true

Type definitions

add any complex types used by soap functions in this class

UserGroup

A User Group entry.

idUser Group ID of the group
nameName of the group

See also

userListAssignableGroups, userAddGroup, userRemoveGroup

User

A User entry.

idUser ID of the user
nicknameUsername used in authentication
emailPrimary email address linked to this user
companynameIncase the user is used by a company, its name
addressIncase the user is used by a company, its billing address
contactnameName of the contact person of this user
contactemailThis field is not used and always contains the empty string
telephoneTelephone number where the contact person can be reached
faxFax number where the contact person can be reached
creditsNumber of credits assigned to this user
clientcodeDeprecated, internal client code, visible to Group::Account admins
commentsComments on the user, visible to Group::Account admins
creationtimeTime the user was created, ‘YYYY-MM-DD HH:MM:SS’ format
lastmodifiedTime the user was last modified, ‘YYYY-MM-DD HH:MM:SS’ format
activeWhether this user is activated
account_idAccount ID of the account this user belongs
account_nameAccount name of the account this user belongs
usergroupsPatterns::{Type}Array of UserGroup entries.
creditthresholdCredit threshold to alert account, 0 to disable.
notificationrecipientsRecipients of credit alert notification: ‘accountcontact’ = contact account contact, ‘user’ = contact user, ‘accountcontact_and_user’ = both

See also

userView, UserGroup

UserCredentials

A UserCredentials entry.

idUser ID of the user.
usernameUsername of the user.
passwordPassword of the user.

UserV2

A UserV2 entry.

idUser ID of the user
nicknameUsername used in authentication
emailPrimary email address linked to this user
balanceAmount of balance the user has.  See also userViewBalance.
balancethresholdBalance threshold to alert account, 0 to disable.
notificationrecipientsRecipients of credit alert notification: ‘accountcontact’ = contact account contact, ‘user’ = contact user, ‘accountcontact_and_user’ = both
companynameIn case the user is used by a company, its name
addressIn case the user is used by a company, its billing address
contactnameName of the contact person of this user
contactemailThis field is not used and always contains the empty string
telephoneTelephone number where the contact person can be reached
faxFax number where the contact person can be reached
clientcodeDeprecated, internal client code, visible to Group::Account admins.  Optional.
commentsComments on the user, visible to Group::Account admins.  Optional.
creationtimeTime the user was created, ‘YYYY-MM-DD HH:MM:SS’ format.  Optional.
lastmodifiedTime the user was last modified, ‘YYYY-MM-DD HH:MM:SS’ format.  Optional.
activeWhether this user is activated
account_idAccount ID of the account this user belongs
account_nameAccount name of the account this user belongs
usergroupsPatterns::{Type}Array of UserGroup entries.

See also

userViewV2, accountUserListV2, accountUserSearchV2, UserGroup

Account

An Account entry.

idAccount ID of the account
nameName of this Account
addressBilling address of the company using the account.
environmentEither ‘test’ or ‘production’.  In the development stage an account is in the ‘test’ environment, and the batch of credits assigned to the account can be used for testing purposes.  Accounts in the ‘production’ environment use actual credits.
resellerIndicates if this account is a webservices reseller
contactnameName of the contact person of this account.
contactemailEmail address of the contact person of this account.
telephoneTelephone number where the contact person can be reached.
faxFax number where the contact person can be reached.
descriptionDescription of the account to its users.
creationtimeTime the user was created, ‘YYYY-MM-DD HH:MM:SS’ format
lastmodifiedTime the user was last modified, ‘YYYY-MM-DD HH:MM:SS’ format
creditsNumber of credits available to this account
clientcodeNot used, always empty
commentsComments on the account, visible to Group::Admins
usernameprefixAll user nicknames in this account start with this prefix
creditthresholdCredit threshold to alert account, 0 to disable.

See also

accountView

Deprecated, see

AccountV2

AccountV2

An AccountV2 entry.

idAccount ID of the account
nameName of this Account
addressBilling address of the company using the account.
environmentEither ‘test’ or ‘production’.  In the development stage an account is in the ‘test’ environment, and the balance assigned to the account can be used for testing purposes without any costs.
resellerIndicates if this account is a webservices reseller
contactnameName of the contact person of this account.
contactemailEmail address of the contact person of this account.
telephoneTelephone number where the contact person can be reached.
faxFax number where the contact person can be reached.
descriptionDescription of the account to its users.
creationtimeTime the user was created, ‘YYYY-MM-DD HH:MM:SS’ format
lastmodifiedTime the user was last modified, ‘YYYY-MM-DD HH:MM:SS’ format
clientcodeNot used, always empty
commentsComments on the account, visible to Group::Admins
usernameprefixAll user nicknames in this account start with this prefix
balanceThe account balance
balancethresholdBalance threshold to alert account, 0 to disable.

See also

accountViewV2

Session

A session entry.

reactid32 character hash string that identified the session
user_idUser ID of the user to which the session belongs
user_nicknameUser nickname of the user to which the session belongs
creationtimeTime the session was created, ‘YYYY-MM-DD HH:MM:SS’ format
lastvisitLast time this session was used, ‘YYYY-MM-DD HH:MM:SS’ format
hitsNumber of times this session has been used.
ipIP string to which the session may optionally be locked

See also

userSessionList

AccountCreationToken

A token for creating a new account via the Webview Interface.

token32 character string for use with the accountGetCreationStatus method
urlThis is the URL where the new account can be created

See also

accountGetCreationToken, accountGetCreationStatus

AccountOrderToken

A token for order account balance via the Webview Interface.

token32 character string for use with the accountGetCreationStatus method
urlThis is the URL where account balance can be ordered

See also

accountGetOrderToken

A User entry.
An Account entry.
Groups give users specific rights.
Retrieve a token with which a new account may be registered via the Webview Interface by one of your customers.
A session represents a valid authentication of a specific user.
An AccountV2 entry.
Create a user, assign it to groups and send it an activation mail.
View the profile of a user.
Returns the users balance.
View the profile of an account.
Get the id of an account created with a token from accountGetCreationToken.
List all users in this account.
Change the current password of a user.
Returns the accounts balance
Retrieve a token that can be used order account balance via the Webview Interface.
A token for creating a new account via the Webview Interface.
The following tables lists the possible error codes.
A token for order account balance via the Webview Interface.
End the session of the current user.
A structure that shows a page of a specific result type {Type}.
A session entry.
Every Account owns an amount of balance.
A UserV2 entry.
User may view and edit his own user profile and view his own logs.
User may create, delete, edit and extensively edit all users in the same account, as well as move credits to and from users.
Edit the complete profile of a user.
Edit the profile of a user.
All usernames of users in this account start with this prefix
The Webservices.nl system admin.
List all groups that the current user can assign to the target user.
Send a notification email to a user with a new password.
Users can be created by the account admin using Webview Interface or using the Accounting::userCreateV2 method.
Add a user to a group.
Remove a user from a group.
Set host restrictions for the user
View host restrictions for the account
View host restrictions for the user
Set host restrictions for the account
An array of type {Type} entries.
A User Group entry.
This method is deprecated, use userViewV2 instead
Search for users of an account using a search phrase.
This method is deprecated, use accountViewV2 instead
Lists all the current valid User::Sessions of a User.