Revver Developer Center: Api : Xml : Methods : User

Revver Developer Center



user.create

Will create a new user as a child user of the authenticated user. Parent user will have full control over child user's account and are expected to provide full support and account access for their child users. Currently, child users cannot log in on Revver.com.

user.create(login [,options])

parameters

login string Required.

Login name for the new user.
Must be unique for this parent account (case insensitive).
Can be mixed case - case is preserved.
Must start with a letter.
14 character maximum.
No spaces or punctuation.
Cannot be an empty string.


A suitable regular expression for login validation is /^[a-zA-Z][a-zA-Z0-9]{1,13}$/

options

password string Optional.
password for the new user. Cannot be the same as the login. If the password is empty, or not supplied, the user will not be able to login.
email string Optional.
User's email address. Must be a properly formed email address, if supplied.
paypal string Optional.
User's paypal address. Must be a properly formed email address, if supplied. User can only receive payment if paypal address is entered.
address object Optional.
address1 string Required.
User's street address.
address2 string Optional.
Additional address information such as suite number.
city string Required.
User's city.
state string Required.
User's state.
postcode string Required.
User's postal code.
country string Required.
User's country.
profile object Optional.
Allows arbitrary key/value pairs of information about the user to be stored for customized account information.
allowBroadcast boolean specifies if the user wishes their content to be broadcast on tv.
allowMobile boolean specifies if the user wishes their content to be distributed via mobile phone.
preRollOptIn boolean specifies if the user wishes to have preroll ads paired with their media. defaults to True.
description string user's description.

return

1100 Server side error.
1102 Login already used.
1103 Password must be different from username.

user.find

Searches for users which match the query filter options. The search results only include child users of the authenticated user. An empty query will return all of the authenticated user's children.

user.find(query, returnFields [,options])

parameters

query object Optional.
Contains filter requirements for the users returned
logins array of strings Returns users with these logins
emails array of strings Returns users whose email matches one of the supplied emails. Matches are case insensitive.
statuses array of strings Returns users in these states. Available states are 'all', 'active', 'suspended' or 'locked'. Default is 'active'.
search string A string that will be matched against full logins and email addresses with wildcards before and after. For example, 'ohn' will match john and johnny.
lastAuthedAfter ISO 8601 return users that have authenticated since this date
lastAuthedBefore ISO 8601 return users that have authenticated before this date
lastAuthedWithin integer takes an integer greater than 0, which is the number of seconds ago that the date occured. E.g. createdWithin=60*60*24*30 will give all users that have authenticated in the last 30 days.

returnFields

Specifies the level of detail returned for users matched by the query.

login string User's login
email string User's email address.
paypal string User's paypal address.
address object
address1 string User's street address.
address2 string Additional address information such as suite number.
city string User's city.
state string User's state.
postcode string User's postal code.
country string User's country.
status string User's status. Possible statuses are 'active', 'suspended' and 'locked'
profile object Contains the arbitrary key/value pairs stored against the user.
balance object Summary of user's account
pending float Account funds waiting approval. These are earnings from the last 30 days and are not payable until payments are cleared.
paid float Earnings that have been paid out to the user to date.
available float Balance available for cash out.
allowMobile boolean specifies if the user wishes their content to be distributed via mobile phone.
preRollOptIn boolean specifies if the user wishes to have preroll ads paired with their media.
lastAuthedDate ISO 8601 Shows when the user last authenticated.
lastUploadDate ISO 8601 Shows when the user last uploaded a video.
preRollOptIn boolean specifies if the user wishes to have preroll ads paired with their media.
description string user's description.
preferMediaOffline boolean specifies whether media uploaded by the user will be automatically set to Offline status upon passing review.

options

limit integer Limit the number of results returned to this number - same effect as "LIMIT" keyword in SQL. There is currently a hard maximum limit of 20.
offset integer Skip the first specified number of results - same effect as "OFFSET" keyword in SQL
count boolean Whether to include a count of the total results that would have been returned ignoring the supplied limit/offset. Default is False.
orderBy array (string, boolean) Returns users ordered by the field specified. If the supplied boolean is True, the results will be in ascending order, false for descending order. Available sort fields are: login, createdDate, lastAuthedDate and balanceAvailable.
final boolean If set to true, includes an indicator as to whether the returned results are the end of the possible results. Default is False.

Note: The final option alters the default return formatting. Instead of a tuple, the return will be a dict.

return

If the supplied count option is false, an array of details defined by the returnFields specified is returned for each user matched. If count is True a tuple is returned: (count, [viddetails, ...])

If the final option is set to true, then a dictionary is returned with the keys:

  • result : user details
  • final : boolean : True if this is the last set of results, False if there are more results
  • count : integer : Number of results that match the query, ignoring limit. Only supplied if the count option is set to True.

user.get

This is a shortcut to calling user.find with a single id. There are no options for this function.

user.get(id, returnFields)

parameters

id Integer The id of the user.

returnFields

The returnFields are the same as those for user.find.

return

Returns a array containing the requested returnFields.

errors

The errors are the same as those for user.find.

user.count

Returns the number of results of a query.

user.count(query)

parameters

query object Optional.
Contains filter requirements for the users returned
logins array of strings Returns users with these logins
emails array of strings Returns users whose email matches one of the supplied emails. Matches are case insensitive.

return

Integer. Returns the number of items matched by the query.

user.authenticate

Tests a user's authentication details. Only children of the authenticated user can be checked.

user.authenticate(login,password)

parameters

login string Required.
Login of user to check.
password string Required.
Password to check

return

True if user authenticated ok, False otherwise.

user.update

Update the user. Only children of the authenticated user can be updated.

user.update(login,options)

parameters

login string Required.
Login of user to update.

options

password string Optional.
password for the new user. Cannot be the same as the login. If the password is empty, or not supplied, the user will not be able to login.
email string Optional.
User's email address. Must be a properly formed email address, if supplied.
paypal string Optional.
User's paypal address. Must be a properly formed email address, if supplied. User can only receive payment if paypal address is entered.
address object Optional.
address1 string Required. (if address specified)
User's street address.
address2 string Optional.
Additional address information such as suite number.
city string Required. (if address specified)
User's city.
state string Required. (if address specified)
User's state.
postcode string Required. (if address specified)
User's postal code.
country string Required. (if address specified)
User's country.
profile object Optional.
Allows arbitrary key/value pairs of information about the user to be stored for customized account information.
allowBroadcast boolean specifies if the user wishes their content to be broadcast on tv.
allowMobile boolean specifies if the user wishes their content to be distributed via mobile phone.
preRollOptIn boolean specifies if the user wishes to have preroll ads paired with their media. defaults to True.
description string user's description.
preferMediaOffline boolean If True, media uploaded by the user will be automatically set to Offline status upon passing review.

errors

In addition to the global API errors, this function can return the following local errors:
1101 Username does not exist
1103 Password must be different from username.

user.delete

Deletes the user. Only children of the authenticated user can be deleted.

user.delete(logins)

parameters

logins array of strings Required.
Logins of users to delete

errors

In addition to the global API errors, this function can return the following local errors:

1101 Username does not exist
1104 User already deleted.

user.undelete

Undeletes the specified user(s). Only children of the authenticated user can be deleted.

user.undelete(logins)

parameters

logins array of strings Required.
Logins of users to delete

errors

In addition to the global API errors, this function can return the following local errors:

1101 Username does not exist
1104 User already undeleted.