Retrieving personal products from Particle API

Hi :nerd_face:

I wonder if I could get some thoughts on an API call I’m making to my console app ?
I’m currently developing a Xamarin application to manage my devices across multiple products as part of a University project.

First question :

I noticed that you can add a client to both your personal account, and individual products. If I set the authentication type to full access on my personal account, should I be able to manipulate all of the products I own too ? Or would I need to authenticate my app against the product too ?

My initial guess was the latter, meaning I would need to iterate over the products in my app, and have the user authorise each individual product in order to create the auth clients.
This leads onto my second question:

Second question :

I’m currently trying to get a list of products against my account (account client is authenticated with full rights), and despite my following the API documentation, I still seem to be getting empty products array. From the call below, is there something I’m missing ?

From my gathering, all I need to do is hit the following endpoint:

[GET] https://api.particle.io/v1/products with the access token as a header, no ?

This seems to always return an empty array.

I then decided to try and get an individual product by it’s slug, or id:

[GET] https://api.particle.io/v1/products/:slugOrId which also returns an empty products array.

Am I missing something in either the authentication process for accounts / products or the way I’m making my calls ?

Many thanks for your time,
Very happy to provide more details on the calls or development environment if needed :slight_smile:

Liam


Update :
I can indeed retrieve single products by passing in the slug id… Small error on my end - still have issues retrieving the full list of products though.

I think the documentation on the Products API is slightly out of date ?

In order to get around my issue, I basically downloaded all of the devices’ data. From that, I could get a list of product ids associated to my devices.

I still can’t download a list of products in a single call, but I can download one product at a time… Crazy, but it works for now.

One thing I noticed when doing this, is the response data I got back from the v1/products/:product_id call what different to what’s documented in the: product section of the documentation

Again, happy to provide more detail on this if it gets picked up :slight_smile: