Versions Compared

Key

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

General Information

...

ServiceAPIMethod
urac/admin/group/addPOST


Data Model: Groups

Workflow: Add Group Flow

Input

...

Type: application/json
NameSourceMandatoryTypeSpecial FormatDescription
tId
codeBodyYESStringAlphanumeric - String - 20 letters Maximum
nameBody
or QuerytCodeBody or Query
YESStringN/A
the Id of the tenant where this group is added

code
descriptionBodyYESStringN/A
the code of the tenant

configBodyYES
String
ObjectN/A
 


allowedPackages
nameBody

YES
StringdescriptionBody
ObjectN/A


^([A-Za-z0-9]+)$
YESArray of strings

Then keys should follow the pattern : 


^([A-Za-z0-9]+)$



allowedEnvironments
NOObjectN/A


^([A-Za-z]+)$
YES
String
ObjectN/A
 

 

for it is just an empty object


Output

...

Valid Response

Code Block
languagejs
titleValid Response Sample
{
	"result": true,
	"data": true
}

...


Invalid Response

Code Block
languagejs
titleError Response Sample
{
    "result":false,
    "errors":{
        "codes":[421],
        "details":[
            {
                "code":421,
                "message":"Group code already exists. Choose another"
            }
        ]
    }
}



Error Codes



 

Code
Description
400Database connection error
421Group code already exists. Choose another
600Database connection error
611invalid tenant id provided


Example (CURL)

...

Request

Code Block
languagebash
titleCalling Add Group API
 > CURL -X POST http://127.0.0.1:4000/urac/admin/group/add?tId=5551aca9e179c39b760f7a1a&tCode=DBTN -d {
'code=gold&name=Gold&description=Group Description'	"code": "silver",
	"name": "Silver Group",
	"description": "grp description",
	"config": {
		"allowedPackages": {
			"prod": ["pack"]
		},
		"allowedEnvironments": {
			"PROD": {}
		}
	}
} 

Response

Code Block
languagejs
titleAdd Group API response
{
	"result": true,
	"data": true{
		"code": "ADMIN",
		"name": "Administration",
		"description": "This is the admin group etc...",
		"config": {
			"allowedPackages": {
				"MOBI": ["MOBI_BASIC"]
			}
		},
		"tenant": {
			"id": "5cadea196d44342107efe52c",
			"code": "TEST"
		},
		"_id": "5cc835c0d7fc2f9c75b9f5ed"
	}
}