Skip to content
Discussions/App Development/Json api queryForum ↗

Json api query

App Development7 posts182 views1 likesLast activity May 2022
DE
DerekOP
May 2022

Hello Daml Community, i tried to list currently active contracts that match a given query.

This is my JAVA CODE:

I get this error:

It is probably a String error, but i am able to create contracts with this code:

CO
cocreature
May 2022

templateIds and readers both need to be an array as described in the docs. so try wrapping the string in [].

DE
Derek
May 2022

Hi cocreature, i already tried with [] but i get the same error in JSON API (400 Bad Request)

My Java Code:

I get a new error in Wireshark but i have no clue:

CO
cocreature
May 2022

Which SDK version are you using?

DE
Derek
May 2022

1.17.1

CO
cocreature
May 2022

The readers field was introduced in SDK 1.18.0. For older versions omit it and the JSON API will read as all actAs & readAs parties in your token.

That said, I do recommend upgrading to SDK 2.1, 1.17.1 is relatively old at this point.

DE
Derek
May 2022

Thank you! i will upgrade and give feedback later

← Back to Discussions