Versions Compared

Key

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

General Information

...

ServiceAPIMethodData ModelWorkflow
urac

/admin/

listUsers

users/ids

GET

...

...

Input

...

Type: application/json
NameSourceMandatoryTypeSpecial FormatDescription
uId
idSQuery
NO
YESStringN/A
If set, the api will return the users of a specific tenant; else the api returns all the users in the databasestart
Users IDs
configQueryNO
Number
ObjectN/A
The start index of the records to get. Default 0limitQueryNONumberN/AThe number of records to get. Default 1000keywordsQuery ||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

...

languagejs
titleError Response Sample

...

Configuration Object


Output

...

Response

SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response 

Valid Response

Code Block
languagejs
titleValid Response Sample
linenumberstrue
collapsetrue
{ 
  result: true,
  data:
  [
    {
      "_id": "5c8d0c505653de3985aa0ffd",
      "locked": true,
      "username": "johnd",
      "firstName": "John",
      "lastName":  "codesDoe":[400],

       "detailsemail":[ "john@localhost.com",
      "ts": 1552747600152,
   {   "status": "active",
            "code"profile":400 {},
      "groups": [
        "message":AAAA"Database
connection error"     ],
      "config": }{
        ]
"packages": {},
   } }

...

Code

...

Description

...

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"keys": true{},
 	"data": [ 		{ 			"_id": "571a2a0e8cc861b98a0b9467", 			"locked": true, 			"usernameallowedTenants": "owner",
			"firstName": "owner",
			"lastName": "owner",
			"email": "owner@soajs.org",
			"ts": 1461332494711,
			"status": "active",
			"profile": {},
			"groups": ["owner"],
			[]
      },
      "tenant": {
				"id": "5551aca9e179c39b760f7a1a",
				"code": "DBTN"
			}
		},
		{
			"_        "id": ObjectId("5d308c68687aaf05b1c240975d9321f8b40e09438afbd0c9"),
        	"lockedcode": true"test",
        	"usernamepin": "owner",{
          	"firstNameallowed": "owner",true
        	"lastName": "owner",}
      }
  	"email": "me@localhost.com", }
  ]
}

Invalid Response

Code Block
languagejs
titleError Response Sample
linenumberstrue
collapsetrue
{
   	 "tsresult": Double(1563462760715.0),
   false,
    	"statuserrors":{
"active",         	"profilecodes": {}[602],
        	"groupsdetails": [
            	"owner"{
        	], 	        "tenantcode":602,
 {       	        "id": "5c0e74ba9acc3c5a84a51259",message":"Model error: + %model_error%"
          	  }
 "code": "DBTN" 	     ]
  }, 		} 	}
	]
}}

Response schema

Follow this link to check out the response JSON Schema

SOAJS Error Codes



Code
Description
400

Business logic required data are missing

602Model error: + %model_error%