Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

General Information

...

ServiceAPIMethod
urac/admin/listUsersGET

...

Data Model: Users

Workflow: List Users Flow

Input

...

Type: application/json
NameSourceMandatoryTypeSpecial FormatDescription
uIdQueryNOStringN/AIf set, the api will return the users of a specific tenant; else the api returns all the users in the database
startQueryNONumberN/AThe start index of the records to get. Default 0
limitQueryNONumberN/AThe number of records to get. Default 1000
keywordsQuery ||BodyNOString

applied towards 

let rePattern = new RegExp(req.soajs.inputmaskData['keywords'], 'i');
condition['$or'] = [
{"email": rePattern},
{"username": rePattern},
{"firstName": rePattern},
{"lastName": rePattern}
];


Output

...

Valid Response

Code Block
languagejs
titleValid Response Sample
{
	"result": true,
	"data": [{
			"..."
		},
		// ...
	]
}


Invalid Response

Code Block
languagejs
titleError Response Sample
{
    "result":false,
    "errors":{
        "codes":[400],
        "details":[
            {
                "code":400,
                "message":"Database connection error"
            }
        ]
    }
}



Error Codes



Code
Description
400Database connection error


Example (CURL)

...

Request

Code Block
languagebash
titleCalling List Users API
 > CURL -X GET http://127.0.0.1:4000/urac/admin/listUsers?tId=5551aca9e179c39b760f7a1a

Response

Code Block
languagejs
titleList Users API response
{
	"result": true,
	"data": [
		{
			"_id": "571a2a0e8cc861b98a0b9467",
			"locked": true,
			"username": "owner",
			"firstName": "owner",
			"lastName": "owner",
			"email": "owner@soajs.org",
			"ts": 1461332494711,
			"status": "active",
			"profile": {},
			"groups": ["owner"],
			"tenant": {
				"id": "5551aca9e179c39b760f7a1a",
				"code": "DBTN"
			}
		},
		{
			"_id": ObjectId("5d308c68687aaf05b1c24097"),
        	"locked": true,
        	"username": "owner",
        	"firstName": "owner",
        	"lastName": "owner",
        	"email": "me@localhost.com",
        	"ts": Double(1563462760715.0),
        	"status": "active",
        	"profile": {},
        	"groups": [
            	"owner"
        	],
	        "tenant": {
    	        "id": "5c0e74ba9acc3c5a84a51259",
        	    "code": "DBTN"
	        },
		}
	}
	]
}

...