fusionauth-netcore-client icon indicating copy to clipboard operation
fusionauth-netcore-client copied to clipboard

DeactivateUsersByIdsAsync should default to using a POST body

Open jobannon opened this issue 2 years ago • 1 comments

When calling client.DeactivateUsersByIdsAsync, FusionAuth will default to sending this request using queryParams as in

DELETE /api/user/bulk?userId={userId}&userId={userId}&userId={userId}&userId={userId}&userId={userId}&userId={userId}&userId={userId}&userId={userId}

It should default to sending this request using a POST body as in:

DELETE /api/user/bulk

with the following example POST body:

{
  "dryRun": true,
  "hardDelete": false,
  "userIds": [
    "5c1dc1a8-2fc8-4ae0-9372-e994be0f4341",
    "dbf59ee1-2d24-4ea0-b977-2b6e2a5350bf",
    "3e74294d-7de7-45a4-9592-4a198ddbdc73",
    "cfaf34a0-aa66-4d3a-af14-6dbc5f9fb577",
    "a2eb9268-e6f1-45f4-8eaa-50c0154983fe",
    "b1b42d6b-3b44-47fb-bb32-26e0c71c62d3",
    "8c91cb08-27df-4725-b3a8-98631bc8d9af",
    "54df878b-c0a1-4951-a63a-3cf2f97edd17",
    "946b3deb-25a5-4155-b137-bb5202d2ac98"
  ]
}

This change will allow for larger requests.

Related documentation and API:

  • https://fusionauth.io/docs/v1/tech/apis/users#bulk-delete-users

Internal: original reporting issue

  • https://inversoft.slack.com/archives/C044F8ME8UV/p1693349199958619?thread_ts=1693348650.562009&cid=C044F8ME8UV

jobannon avatar Sep 01 '23 20:09 jobannon

Will need to change or augment the source JSON for this API call:

https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/api/deactivateUsersByIds.json

For backwards compatibility, probably best to create a new API.json document. Maybe deactivateUsersByIdsWithBody.json or similar?

Here's an example where params are sent in the body rather than the parameter: https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/api/searchUsersByQuery.json

mooreds avatar Sep 05 '23 02:09 mooreds