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