Skip to content

Error when adding more than 10 groups per action #58

@adorton-adobe

Description

@adorton-adobe

The UMAPI does not allow more than 10 group assignments per action. umapi-client must detect group addition actions containing more than 10 groups and split them into multiple actions.

Here's an example of a call that adds too many groups in one action:

Request:

[  
   {  
      "user":"testuser1@ccestestdomain.com",
      "requestID":"action_1",
      "do":[  
         {  
            "createEnterpriseID":{  
               "email":"testuser1@ccestestdomain.com",
               "option":"ignoreIfAlreadyExists",
               "country":"US"
            }
         },
         {  
            "add":{  
               "product":[  
                  "too many groups 11",
                  "too many groups 4",
                  "too many groups 5",
                  "too many groups 14",
                  "too many groups 12",
                  "too many groups 9",
                  "too many groups 10",
                  "too many groups 7",
                  "too many groups 3",
                  "too many groups 6",
                  "too many groups 15",
                  "too many groups 13",
                  "too many groups 1",
                  "too many groups 2",
                  "too many groups 8"
               ]
            }
         }
      ]
   }
]

Result:

{
    "completed": 0,
    "notCompleted": 1,
    "completedInTestMode": 0,
    "result": "error",
    "errors": [
        {
            "index": 0,
            "step": 0,
            "message": "Too many products, users or groups in Add or Remove: max is 10",
            "errorCode": "error.command.add_remove.list_too_long"
        }
    ]
}

And here is the corrected request:

[  
   {  
      "user":"testuser1@ccestestdomain.com",
      "requestID":"action_1",
      "do":[  
         {  
            "createEnterpriseID":{  
               "email":"testuser1@ccestestdomain.com",
               "option":"ignoreIfAlreadyExists",
               "country":"US"
            }
         },
         {  
            "add":{  
               "product":[  
                  "too many groups 11",
                  "too many groups 4",
                  "too many groups 5",
                  "too many groups 14",
                  "too many groups 12",
                  "too many groups 9",
                  "too many groups 10",
                  "too many groups 7",
                  "too many groups 3",
                  "too many groups 6",
              ],
            }
         },
         {
         	"add":{
         		"product":[
                  "too many groups 15",
                  "too many groups 13",
                  "too many groups 1",
                  "too many groups 2",
                  "too many groups 8"
               ]
            }
         }
      ]
   }
]

Result:

{
    "completed": 1,
    "notCompleted": 0,
    "completedInTestMode": 0,
    "result": "success"
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions