Comments (1)
Hiya,
I agree that this isn't the clearest documentation. Sorry about that. The PHP client library doesn't support the two parameter based delete methods, but does support the request body based methods. These are documented here: https://fusionauth.io/docs/v1/tech/apis/groups/#request-body-4
If you know the user's membership id, you can delete it directly by building json like:
{
"memberIds": [
"222b884b-a0a1-4563-a957-89c7c0513e6e",
"80d474bf-0dee-4009-b793-ec1255693fa3",
"16d98a8b-4205-4441-8831-7e3f73154134"
]
}
If you don't know the membership ids (which I believe is what you are looking for) but do know the group and the user id, you can also remove memberships in that way:
{
"members": {
"1188edfc-cef3-4555-910e-181ddf6153c0": [
"578e52df-83e8-48ca-899b-3aefd56e7fc5",
"0928cf95-34d1-44cc-9114-da68a07e5ff8"
]
}
}
Here's a curl example:
curl -XDELETE -H 'Content-type: application/json' -H "Authorization: $API_KEY" 'http://localhost:9011/api/group/member' -d '
{
"members": {
"63437023-6fc7-4f8f-9759-e325c896fef3":
[
"00000000-0000-0000-0000-000000000006"
]
}
}'
In PHP the object would look like this:
$request_object = [
"members" => [
"63437023-6fc7-4f8f-9759-e325c896fef3" => [
"00000000-0000-0000-0000-000000000006"
]
]
];
Note that there is an issue with the docs linked above, they have an extra array between the group id and the list of user ids, but I'll get that fixed.
Hope this helps.
from fusionauth-php-client.
Related Issues (16)
- PSR autoload is failing because of case insensitive namespace HOT 1
- forgotPassword method issue with TenantId HOT 6
- No X-FusionAuth-TenantId header when using withTenantId method HOT 1
- PHP Login User Example Does Not Work HOT 5
- User Sign In Successfully but NOT Signed In to FusionAuth & Everywhere HOT 1
- Is issue #833 back again? HOT 7
- Getting error due to Silent Mode HOT 1
- Cut 'empty' params in request (JSONBody) HOT 2
- getting invalid_redirect_uri HOT 1
- Support php 8.1 HOT 1
- Missing PHP version constraint HOT 4
- Timeouts and other cURL errors are not handled HOT 1
- Deprecated doc
- Methods using the JWT authorization are failing HOT 1
- option to set TenantID is missing. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusionauth-php-client.