Trouble Accessing Ledger Instances via Particle Cloud API

Hi everyone,

I’m trying to use the Ledger API to manage device-specific data in my Particle product, but I’m struggling to understand how the get ledger instance API is supposed to work. Here’s what I’ve done so far:

  1. Added device scoped cloud-to-device Ledger definition in the console to my product
  2. Added an instance of my ledger definition in the console
  3. Added a Product level API user in the console
  4. Added the Bearer Token to my Postman auth
  5. Called https://api.particle.io/v1/ledgers/sound-command/instances

I get:

{
    "instances": [],
    "meta": {
        "page": 1,
        "per_page": 100,
        "total_pages": 0,
        "total": 0
    }
}

I can't remember exactly what else I tested, but I made sure the token was fine by testing all the product APIs. I also tested some other Ledger APIs (like List Ledger Definitions) using the product id or org slug to no avail.

Is there some sort of product level API for ledgers I need to be using? I am wondering if I need to make an org level API user and org level Ledger for this? Any help is greatly appreciated!

I seem to always post a bit too early on here. I figured it out. First I realized there is a product based API for ledgers by appending product/:productID into the URL eg:

https://api.particle.io/v1/products/:productId/ledgers/:ledgerName/instances/:scopeValue

And it doesn't seem like the API User works with these, but I made a different access token with a higher level of access. Thanks all who read this!

1 Like