โ05-06-2024 12:27 AM
Hi All,
I want to add a member to a group in databricks account level using rest api (https://docs.databricks.com/api/azure/account/accountgroups/patch) as mentioned in this link I could able to authenticate but not able to add member while using below body. Could please someone guide what i missed to add in body?
{"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations":[
{
"op": "add",
"path": "/members",
"value": "xyz@abcdcomapny.com"
}
]
}
โ05-06-2024 01:33 AM
Hi @pragarwal,
The body youโve shared is almost correct. However, thereโs a small issue. Instead of directly providing the email address as the value, you need to provide an object with the "value"
field set to the email address. Hereโs the corrected body:
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "add",
"path": "/members",
"value": {
"value": "xyz@abcdcompany.com"
}
}
]
}
Note that we wrap the email address in an object with a "value"
field.
โ05-06-2024 05:22 AM
Hi @Kaniz_Fatma
I have tried suggest body also but still member is not added to group. is there any other method that i can use add member to the group at account level
Thanks,
Phani.
โ07-09-2024 06:26 AM
@Kaniz_Fatma I am having the same issue as @pragarwal : after sending the api request and getting success code 200 the member is not added to the admin group.
โ07-23-2024 06:36 PM - edited โ07-23-2024 07:40 PM
I am working on workspace-local group APIs on Azure Databricks though what @Kaniz_Fatma suggested did not work to me too. I checked the payload sent from Databricks workspace frontend and the following worked to me. Has API signature been changed but document hasn't been updated?
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "add",
"value": {
"members": [
{
"value": "0000000000000000 (replace this with your Databricks USER ID)"
}
]
}
}
]
}
Edit:
I am using PATCH `/api/2.0/preview/scim/v2/Groups/{id}` API. I found another doc which looks like v2.1 API reference and the signature looks quite similar to what I used.
Account SCIM 2.1 Documentation (databricks.com)
โ07-27-2024 01:05 PM - edited โ07-27-2024 06:08 PM
Looks like value should be an array. This worked to me to add three users to a group. Replace xxx/yyy/zzz with account ID.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"path": "members",
"op": "add",
"value": [
{
"value": "xxx"
},
{
"value": "yyy"
},
{
"value": "zzz"
}
]
}
]
}
On the other hand, remove operation seems a bit different format. Add remove operation for each entry to remove. Here is an example to remove three users with ID xxx, yyy and zzz from a group.
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "remove",
"path": "members[value eq \"xxx\"]"
},
{
"op": "remove",
"path": "members[value eq \"yyy\"]"
},
{
"op": "remove",
"path": "members[value eq \"zzz\"]"
}
]
}
2 weeks ago - last edited 2 weeks ago
Does the above work? I still can't quite figure it out. Any help would be much appreciated.
I know authentication is not an issue as I can use a lot of the other endpoints. I just can't figure out the correct body syntax to add a member to a group.
url= https://accounts.azuredatabricks.net/api/2.0/accounts/<account_id>/scim/v2/Groups/<group_id>
data= {
'schemas': [
'urn:ietf:params:scim:api:messages:2.0:PatchOp'
],
'Operations': [
{
'op': 'add',
'path': '/members',
'value': {
'value': '<user>@<domain>.com'
}
}
]
}
header={'Content-Type': 'Authorization': 'Bearer <token>'}
My code is
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group