You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by rajkumar <ra...@gmail.com> on 2017/05/29 09:34:15 UTC

Bulk Deletion of Users using APIs

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
<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

--
View this message in context: http://syncope-user.1051894.n5.nabble.com/Bulk-Deletion-of-Users-using-APIs-tp5709247.html
Sent from the syncope-user mailing list archive at Nabble.com.

Re: Bulk Deletion of Users using APIs

Posted by rajkumar <ra...@gmail.com>.
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

--
View this message in context: http://syncope-user.1051894.n5.nabble.com/Bulk-Deletion-of-Users-using-APIs-tp5709247p5709251.html
Sent from the syncope-user mailing list archive at Nabble.com.

Re: Bulk Deletion of Users using APIs

Posted by Francesco Chicchiriccò <il...@apache.org>.
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/


Re: Bulk Deletion of Users using APIs

Posted by rajkumar <ra...@gmail.com>.
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

--
View this message in context: http://syncope-user.1051894.n5.nabble.com/Bulk-Deletion-of-Users-using-APIs-tp5709247p5709249.html
Sent from the syncope-user mailing list archive at Nabble.com.

Re: Bulk Deletion of Users using APIs

Posted by Francesco Chicchiriccò <il...@apache.org>.
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/