# JSON API contract creation on sandbox gives HTTP 400

**URL:** <https://forum.canton.network/t/json-api-contract-creation-on-sandbox-gives-http-400/3334>\
**Category:** App Development\
**Tags:** json-api, sandbox\
**Created:** [October 20, 2021, 4:21am UTC](https://forum.canton.network/t/json-api-contract-creation-on-sandbox-gives-http-400/3334 "2021-10-20T04:21:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theja](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Theja](https://forum.canton.network/u/Theja)\
**Post date:** [October 20, 2021, 4:21am UTC](https://forum.canton.network/t/json-api-contract-creation-on-sandbox-gives-http-400/3334/1 "2021-10-20T04:21:58Z")

</div>

Hi team,

I’m getting bad request response with JSON API contract creation. Error message refers data type issue of DA.Set and JsonArray.

Appreciate your help.

DAML version - 1.16.0

# DAML template

template LedgerTest  
with  
owner : Party  
obs : Set Party  
slotKey : Int  
version: Int  
timeStamp : Time  
where  
signatory owner  
observer obs

# Request Body

{

“templateId”: “5d448c13ba2ed7dea9c6b97a4abf690d6f78c605fac96bb098e60b6dbdbf81d3:Main:LedgerTest”,

“payload”: {

“owner”: “Alice”,

“obs”: ,

“slotKey”: 1,

“version”: 1,

“timestamp”: “2021-10-20T03:06:56.326Z”

},

“meta”: {

“commandId”: “f7a21b8c-982d-4ec7-89ac-9e27468e03cb”

}

# Response

{

“errors”: [

**“JsonError: spray.json.DeserializationException: Can’t read [] as DamlLfRecord 97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657:DA.Set.Types:Set, wrong number of record fields (expected 1, found 0).”**

],

“status”: 400

}

Thanks,  
Thejaswani

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [October 20, 2021, 6:42am UTC](https://forum.canton.network/t/json-api-contract-creation-on-sandbox-gives-http-400/3334/2 "2021-10-20T06:42:39Z")

</div>

Hi @Theja, take a look at [REST JSON Specification - #2 by cocreature](https://discuss.daml.com/t/rest-json-specification/2429/2) which tackles the same topic.

To summarize, `Set` is a record wrapper around `Map` so you need something like `{"map": []}` for an empty Set instead of `[]`.

---

<div class="post-metadata">

**Author:** ![Theja](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Theja](https://forum.canton.network/u/Theja)\
**Post date:** [October 20, 2021, 10:49pm UTC](https://forum.canton.network/t/json-api-contract-creation-on-sandbox-gives-http-400/3334/3 "2021-10-20T22:49:32Z")

</div>

Thank you @cocreature works now 👍🏻
