<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00007fnrUrSAIOkta Classic EngineLifecycle ManagementAnswered2024-04-16T09:10:28.000Z2020-01-29T04:47:45.000Z2020-04-01T23:36:18.000Z

hflt4 (hflt4) asked a question.

API "Create Group Rule" gets error "The endpoint does not support the provided HTTP method"

When I tried to call POST API to create a group, I got error. The request code is almost the same as on the https://developer.okta.com/docs/reference/api/groups/*create-group-rule

 

python3:

request_body = {

 "type": "group_rule",

 "name": "my test group",

 "conditions": {

"people": {

"users": {

"exclude": []},

"groups": {

"exclude": []}

},

"expression": {

"value": "isMemberOfAnyGroup(\"00gjtfmh65gTwRMc80h7\")",

"type": "urn:okta:expression:1.0"

}

},

 "actions": {

"assignUserToGroups": {

 "groupIds": ["00gjxxxxxxxxxxxxx0h7"]

}

 }

}

print(request_body)

create_grp_rule_response = requests.post(request_url, json=request_body, headers=headers).json()

print(create_grp_rule_response)

 

the result is:

{'type': 'group_rule', 'name': 'my test group', 'conditions': {'people': {'users': {'exclude': []}, 'groups': {'exclude': []}}, 'expression': {'value': 'user.role=="Engineer"', 'type': 'urn:okta:expression:1.0'}}, 'actions': {'assignUserToGroups': {'groupIds': ['00gjxxxxxxxxxxxxx0h7']}}}

{'errorCode': 'E0000022', 'errorSummary': 'The endpoint does not support the provided HTTP method', 'errorLink': 'E0000022', 'errorId': 'oaeGKhKV4KRRC-hItVfZE_thg', 'errorCauses': []}

 

 

I also tried request.post, it's the same error message.

While I tried the body part in Postman, it shows successful.

 

Can someone help to figure out how to fix this issue?

 

 


  • Hey there! Sorry for the lack of response here on the Discussions forum. If you’re still looking for an answer, I would recommend checking out our Developer resources, including the Developer Forum (https://devforum.okta.com/) and documentation. If you are unable to find the solutions you're looking for there, we would encourage you to contact our dedicated Developer Support team at developers@okta.com, and they will be able to help you out.

    Expand Post
This question is closed.
Loading
API "Create Group Rule" gets error "The endpoint does not support the provided HTTP method"