Delete user about api

Hello,

I would like to delete a user from our ERP system using api.
The code is this:
AccessToken := Auth0GetAccessToken();
Auth0_UserId := Auth0GetUserId(ContactNo,AccessToken);

Url := ‘https://sp-client-platform.eu.auth0.com/api/v2/users/auth0|639axxxxxxxxxxx’;

HttpWebRequestMgt.Initialize(Url);
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod(‘Delete’);
//HttpWebRequestMgt.SetReturnType(‘application/json’);
HttpWebRequestMgt.SetContentType(‘application/json’);

HttpWebRequestMgt.AddHeader(‘authorization’,'Bearer ’ + AccessToken);
HttpWebRequestMgt.AddHeader(‘Content-Type’,‘application/json’);
HttpWebRequestMgt.SendRequestAndReadTextResponse(ResponseBody,ErrorMessage,ErrorDetails,HttpStatusCode,ResponseHeaders);
IF HttpStatusCode <> 204 THEN
ERROR(‘Fehler bei Auth0DeleteUser. %1 %2 %3 %4 %5’,ErrorMessage,ErrorDetails,HttpStatusCode,ResponseBody,ResponseHeaders)

unfortunately this does not work. error is:
400 Bad Request

What could be wrong with that?

thanks
stony

Hey there @manfred.steinbacher welcome to the community!

I assume you are using a Management API access token for this request? Have you been able to locate the this in the logs in your tenant dashboard - There might be more information regarding the reason for the 400 there.

Let us know!

Hi,
I got this response from our application.
image
And this is the information from the log system.

thanks