get_user_changes

The get_user_changes method retrieves a summary of the changes made to a user account.

Syntax

{
    <credentials object>, 
    "user": <mailbox_name>, 
    "range": {
       "first": <number>,
       "limit": <number> 
}

Request fields for get_user_changes

The following fields can be used in the get_user_changes method:

Field name

Obligation

Definition/Value

range

Optional

The range of results to return. Allowed values are:

  • first—The 0-based index of the first result to return.

  • limit—The maximum number of results to return.

user

Required

The name of the user's account.

Response fields for get_user_changes

The following fields may be returned in response to the get_user_changes method:

Field name

Obligation

Description/Value

changes

Returned if success = true

An array of hashes, one hash for each change returned. The array is sorted by the time of the change, with the earliest change listed first. For each change the following information is returned:

  • application—The name of the application used to perform the change.

  • msg—A brief summary of the change made. If the changed data is short, it is shown;; otherwise, the number of bytes in the new value is shown

  • time—The time that the change was made, in UNIX Epoch time.

  • user—The name of the user that performed the change. If the change was performed by the system, the user "OpenSRS" is shown.

count

Returned if success = true

The number of items (changes) in the array.

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

success

Always returned

Indicates whether the request was successful or not. Allowed values are true and false.

total_count

Returned if success = true

The total number of changes available.

Examples for get_user_changes

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "pencil75"
  },
  "range": {
    "first": 20,
    "limit": 10
  },
  "user": "[email protected]"
}

Response

{
  "success": true,
  "total_count": 29,
  "count": 9,
  "changes": [
		{
			"msg": "changed default_sort_order [descending]", 
      "time": "1321903552",
			"application": "OMA",
			"user": "[email protected]"
		}, 
		{
    	"msg": "changed timezone [America/Montreal]", 
      "time": "1321903552",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed language [en]",
			"time": "1321903552",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed name [Janet User]",
			"time": "1321903552",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed confirm_send [false]", 
      "time": "1321903552",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed msgs_per_page [20]", 
      "time": "1321903552",
      "application": "OMA",
      "user": "[email protected]"
    }, 
		{
    	"msg": "changed spamtag [[JUNK]]",
			"time": "1321903721",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed sessions [32 bytes]",
			"time": "1321907872",
			"application": "OMA",
			"user": "[email protected]"
    }, 
		{
    	"msg": "changed block [*@badmail.com]", 
      "time": "1327005780",
			"application": "mac:OMA",
			"user": "[email protected]"
    } 
  ]
}