# HTTP JSON API vs Ledger API

**URL:** <https://forum.canton.network/t/http-json-api-vs-ledger-api/2514>\
**Category:** App Development\
**Tags:** daml, json-api, sandbox, ledger-api\
**Created:** [April 25, 2021, 9:10am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514 "2021-04-25T09:10:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaileytaha](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dhaileytaha/32/1608_2.png) [@dhaileytaha](https://forum.canton.network/u/dhaileytaha)\
**Post date:** [April 25, 2021, 9:10am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/1 "2021-04-25T09:10:29Z")

</div>

Hi,  
I went through the docs for HTTP JSON API and i am aware of the limitation mentioned here:  
[https://docs.daml.com/0.13.38/json-api/index.html](https://docs.daml.com/0.13.38/json-api/index.html)

Apart from this is there any advantages and limitation for using HTTP JSON API service?

Also in future, is there any development to include all LEDGER API features in JSON API service?

Thanks

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [April 26, 2021, 6:19am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/2 "2021-04-26T06:19:58Z")

</div>

Howdy @dhaileytaha 👋

> [@dhaileytaha](#):
>
> [HTTP JSON API Service — DAML SDK 2020-01-17 documentation](https://docs.daml.com/0.13.38/json-api/index.html)

That’s an old HTTP JSON API page (v.013.38). You can find the latest one [here](https://docs.daml.com/1.12.0/json-api/index.html) with an explanation on why not all functionalities of the Ledger API have been included.

> HTTP JSON API Service
> 
> The **JSON API** provides a significantly simpler way to interact with a ledger than [the Ledger API](https://docs.daml.com/1.12.0/app-dev/ledger-api.html) by providing _basic active contract set functionality_ :
> 
> - creating contracts,
> - exercising choices on contracts,
> - querying the current active contract set, and
> - retrieving all known parties.
> 
> The goal of this API is to get your distributed ledger application up and running quickly, so we have deliberately excluded complicating concerns including, but not limited to:
> 
> - inspecting transactions,
> - asynchronous submit/completion workflows,
> - temporal queries (e.g. active contracts _as of a certain time_ )

Out of curiosity are you using v 0.13.38 of the Daml Connect SDK specifically?

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [April 26, 2021, 8:11am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/3 "2021-04-26T08:11:19Z")

</div>

> [@dhaileytaha](#):
>
> Also in future, is there any development to include all LEDGER API features in JSON API service?

There are no such plans at the moment. What features exactly would you like to be there?

---

<div class="post-metadata">

**Author:** ![dhaileytaha](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dhaileytaha/32/1608_2.png) [@dhaileytaha](https://forum.canton.network/u/dhaileytaha)\
**Post date:** [April 27, 2021, 5:23am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/4 "2021-04-27T05:23:15Z")

</div>

Thanks for the response, I am not looking for a specific feature for now. Probably once the project starts, there might be some features nice to be in json-api as well.

**But there is one feature i ask to ask about is JSON-API synchronous, it waits for command to success or fail?**  
As per the doc for “asynchronous submit/completion workflows” we need ledger API.

For now, i was trying to understand the limitation and if there is any progress upcoming for json-apis

Thanks

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [April 27, 2021, 5:52am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/5 "2021-04-27T05:52:59Z")

</div>

In the Ledger API you have two ways of submitting a command, you either:

- use the `CommandSubmissionService#Submit` method and listen for the completion using the `CommandCompletionService#CompletionStream` method
- use the `CommandService#SubmitAndWait` method, which makes the Ledger API server take care of tracking

The former is not used by the JSON API, but in practice there is little difference between the two. The latter is more convenient for the client, the former allows the client to independently track issued commands and completions, offloading this duty from the server and allowing more fine grained approach to dealing with back-pressure. Apart from this, all the asynchronous submit/completion workflow does is keeping the in-flight commands state on the server. The client-observed behavior is synchronous but internally the flow is still asynchronous.

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [April 27, 2021, 10:35am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/6 "2021-04-27T10:35:47Z")

</div>

The JSON API has mostly synchronous endpoints for “write” commands, but does have websocket-based asynchronous “read” commands.

---

<div class="post-metadata">

**Author:** ![dhaileytaha](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dhaileytaha/32/1608_2.png) [@dhaileytaha](https://forum.canton.network/u/dhaileytaha)\
**Post date:** [April 28, 2021, 10:34am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/7 "2021-04-28T10:34:10Z")

</div>

![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/1/179639f33a9fc86646be89dd185ef73e448ba8c0.png)

Using this version.  
What is curiosity about?

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [April 28, 2021, 11:02am UTC](https://forum.canton.network/t/http-json-api-vs-ledger-api/2514/8 "2021-04-28T11:02:32Z")

</div>

Thnx for the info 🙂

You referenced an older version of the JSON API (0.13.38) so was wondering if there’s anything special about it that might fulfil the needs for your project. I see you’re using a newer version of the SDK actually (1.11.0)
