Moab Web Services > Resources > Accounting > Accounting Users

Accounting Users

This section describes the services available through Moab Web Services for interacting with the User object in Moab Accounting Manager. It contains the URLs, request bodies, and responses delivered to and from MWS as an intermediary for MAM.

The Fields: Users reference contains the type and description of all fields in the User object.

Supported methods

Resource GET PUT POST DELETE
rest/accounting/users Get All Users -- -- --
rest/accounting/users/<id> Get Single User -- -- --

This topic contains these sections:

Getting Users

The HTTP GET method is used to retrieve User information.

Quick reference

GET http://localhost:8080/mws/rest/accounting/users?api-version=3
GET http://localhost:8080/mws/rest/accounting/users/<id>?api-version=3

Get All Users

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/users?api-version=3&proxy-user=<user>[&query=<query_conditions>][&fields=<fields_to_display>[&sort=<fields_to_sort>]|&show-all=(true|false)]
Parameter Required Type Valid values Description Example
proxy-user Yes String -- Perform action as defined MAM user. proxy-user=amy
query No JSON --

Results are restricted to those having the specified field values.

The query parameter does not support the full Mongo query syntax. Only querying for a simple, non-nested JSON object is allowed.

query={"active":true}
fields No String -- Comma-separated list of field names to display. fields=name,defaultAccount
sort No JSON -- Sort the results. Use 1 for ascending and -1 for descending. Should be used in conjunction with the fields parameter. sort={"defaultAccount":1}
show-all No Boolean true or false true shows all fields including metadata and hidden fields. Default is false. show-all=true

See Global URL Parameters for available URL parameters.

Sample response

GET http://localhost:8080/mws/rest/accounting/users?api-version=3&proxy-user=moab&query={"active":true}&pretty=true
------------------------------------

{
  "totalCount": 6,
  "resultCount": 4,
  "results":   [
        {
      "active": true,
      "commonName": "",
      "phoneNumber": "",
      "emailAddress": "",
      "defaultAccount": "",
      "description": "Accounting Admin",
      "id": "scottmo"
    },
        {
      "active": true,
      "commonName": "Amy Miller",
      "phoneNumber": "(801) 555-1437",
      "emailAddress": "[email protected]",
      "defaultAccount": "chemistry",
      "description": "",
      "id": "amy"
    },
        {
      "active": true,
      "commonName": "Robert Taylor",
      "phoneNumber": "(801) 555-1474",
      "emailAddress": "[email protected]",
      "defaultAccount": "biology",
      "description": "",
      "id": "bob"
    },
        {
      "active": true,
      "commonName": "David Jones",
      "phoneNumber": "(801) 555-1436",
      "emailAddress": "[email protected]",
      "defaultAccount": "film",
      "description": "",
      "id": "dave"
    }
  ]
}

Get Single User

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/users/<id>?api-version=3&proxy-user=<user>[&fields=<fields_to_display>|&show-all=(true|false)]
Parameter Required Type Valid values Description Example
id Yes String -- The unique identifier of the object --
fields No String -- Comma-separated list of field names to display. fields=name,defaultAccount
show-all No Boolean true or false true shows all fields including metadata and hidden fields. Default is false. show-all=true

See Global URL Parameters for available URL parameters.

Sample response

GET http://localhost:8080/mws/rest/accounting/users/amy?api-version=3&proxy-user=moab&pretty=true
------------------------------------

{
  "active": true,
  "commonName": "Amy Miller",
  "phoneNumber": "(801) 555-1437",
  "emailAddress": "[email protected]",
  "defaultAccount": "chemistry",
  "description": "",
  "id": "amy"
}

Related Topics 

© 2015 Adaptive Computing