# Get the Public Party token

**URL:** <https://forum.canton.network/t/get-the-public-party-token/2300>\
**Category:** App Development\
**Tags:** daml, json-api, damlhub, ledger-api\
**Created:** [March 19, 2021, 8:16pm UTC](https://forum.canton.network/t/get-the-public-party-token/2300 "2021-03-19T20:16:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Med\_Amine\_ID](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/med_amine_id/32/1530_2.png) [@Med\_Amine\_ID](https://forum.canton.network/u/Med_Amine_ID)\
**Post date:** [March 19, 2021, 8:16pm UTC](https://forum.canton.network/t/get-the-public-party-token/2300/1 "2021-03-19T20:16:23Z")

</div>

Hello guys,  
we were able to fetch the public id but not the public token  
here is the call POST [api.projectdabl.com/api/ledger/](http://api.projectdabl.com/api/ledger/)/public/token  
reponse:  
{  
“code”: “missing\_token”,  
“description”: “this endpoint requires a valid token and none was supplied”,  
“success”: false  
}

if anyone has an idea?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Leonid\_Rozenberg](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonid_rozenberg/32/48_2.png) [@Leonid\_Rozenberg](https://forum.canton.network/u/Leonid_Rozenberg)\
**Post date:** [March 19, 2021, 8:27pm UTC](https://forum.canton.network/t/get-the-public-party-token/2300/2 "2021-03-19T20:27:17Z")

</div>

Hello @Med_Amine_ID and welcome to the forum. We actually created a little library to make it easier to write UIs for dabl. [@daml/hub-react - npm](https://www.npmjs.com/package/@daml/hub-react) . Within a `PublicLedger` React context that fetch is handled for you and you can just get data as the `Public` party.

With respect to your _specific_ question, you forgot to insert the `ledgerId` into the URL for the token (at according to [this](https://github.com/digital-asset/dabl-react/blob/121fef82cb239727ab53a3299bcd1f07540d4cce/PublicLedger.ts#L7) code 😃 ).

---

<div class="post-metadata">

**Author:** ![Med\_Amine\_ID](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/med_amine_id/32/1530_2.png) [@Med\_Amine\_ID](https://forum.canton.network/u/Med_Amine_ID)\
**Post date:** [March 20, 2021, 12:56am UTC](https://forum.canton.network/t/get-the-public-party-token/2300/3 "2021-03-20T00:56:35Z")

</div>

Thank you for your answer I will check it out and I did have the correct ledgerId on my request just a typo from my end.
