Bulk Deletion of Users using APIs

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bulk Deletion of Users using APIs

rajkumar
Hi,

I am working on Syncope 2.0.3 and i have pulled nearly 5000 users. I just want to delete all the users and need to do synchronization again. I have tried following below URL.

https://cwiki.apache.org/confluence/display/SYNCOPE/Delete+several+users+at+once

It is working fine for lower version  but not working fine for higher version. Kindly help me to fix this and delete all users.

Note: When tried "bulk" i got (500 internal Error)

Thanks,
Rajkumar Kanikumar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bulk Deletion of Users using APIs

ilgrosso
Administrator
On 29/05/2017 11:34, rajkumar wrote:

> Hi,
>
> I am working on Syncope 2.0.3 and i have pulled nearly 5000 users. I just
> want to delete all the users and need to do synchronization again. I have
> tried following below URL.
>
> https://cwiki.apache.org/confluence/display/SYNCOPE/Delete+several+users+at+once
>
> It is working fine for lower version  but not working fine for higher
> version. Kindly help me to fix this and delete all users.

As the big warning on top of that wiki page states, the content is for
Syncope <= 1.2, and you need to go to

http://syncope.apache.org/docs/reference-guide.html#client-library

for Syncope 2.0; in particular, the Example 12.

HTH
Regards.

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bulk Deletion of Users using APIs

rajkumar
Hi,

Really thanks for your quick reply, But the URL you have shared given the Java coding but i want to do this bulk deletion using any API client. Below are the values i am using to achieve the same and let me know if am doing any mistake here.

URL : http://52.58.169.64:8080/syncope/rest/users
Type : Delete
Payload: {
  "operation":"DELETE",
  "targets":[
    "{id}"
  ]
}
content-type - application/json

But deleting single user is working fine with below details:

URL : http://52.58.169.64:8080/syncope/rest/users/{userId}
Type : Delete



Also please let me know, is there a way to run multiple HTTP request at same time in postman.

Thanks,
Rajkumar kanikumar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bulk Deletion of Users using APIs

ilgrosso
Administrator
On 29/05/2017 13:05, rajkumar wrote:
> Hi,
>
> Really thanks for your quick reply, But the URL you have shared given the
> Java coding but i want to do this bulk deletion using any API client.

I see, ok.

> Below
> are the values i am using to achieve the same and let me know if am doing
> any mistake here.
>
> *URL *: http://52.58.169.64:8080/syncope/rest/users
> *Type* : Delete
> *Payload*: {
>    "operation":"DELETE",
>    "targets":[
>      *"{id}"*
>    ]
> }
> *content-type* - application/json

This cannot work.

> But deleting single user is working fine with below details:
>
> *URL *: http://52.58.169.64:8080/syncope/rest/users/{userId}
> *Type* : Delete

This is fine, of course.

> *Also please let me know, is there a way to run multiple HTTP request at
> same time in postman.*

I would suggest to enable Swagger UI in your deployment and look at POST
/user/bulk under _users; it should be something like as

*URL *: http://52.58.169.64:8080/syncope/rest/users/bulk
*Type* : POST
*Payload*: {
   "type":"DELETE",
   "targets":[
     *"{key}"*
   ]
}

Regards.

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bulk Deletion of Users using APIs

rajkumar
Hi,

Thanks a lot, It got worked. Reason for not working is - instead of using rest/users/Bulk i was using rest/users.

I have changed that and now it is working fine. Thanks for your timely help.

Thanks,
Rajkumar Kanikumar
Loading...