Cloud SDK delete customer JSON request

Had a question about how to delete customers. I’ve been able to integrate in most of the Particle-windows-SDK and have a series of unit tests where deleting test customers would be a good idea. I’m running these particular unit tests sparingly right now so that I don’t pile up a lot of entries in the Particle cloud database.

I’ve searched for posts on this topic and from reading them I know that support for deleting test customers in the windows SDK is a current open request … and I’m guessing that it’s probably lower priority than a whole lot of other requests you probably have…

So, thinking I could put this in on my own, I noticed in the Particle Cloud API documentation ( that there is a specified JSON request to delete a customer. It uses an access token.

I’ve tried this function but am not able to get it to work. I consistently get back “Organization not found for user’s role”. In making this call I’m using the credentials of the customer I want to delete to get an access token, and then using that access token to make the json call to delete the customer as per my understanding of the documentation. The product id is correct as near as I can determine at my end, and I can make other calls using JSON requests successfully. Any guidance on this?


Could you try using the organizations accesstoken, rather than the customer’s token?

Hi Moors7,

Can you clarify which JSON api call I use to get an organizations token? Based on your suggestion, I tried using my own credentials (I was the one who set up the company account) not using particle:particle and used that returned token for the delete call and received back an error 400- bad request from the server.

Can you point me to the particular Cloud API JSON request I should be using to generate this particular token?