Trying to create department but getting error

Haseeb.Ahmad9092
Haseeb.Ahmad9092 Posts: 5 🌱
edited November 2022 in Development

I am trying to create a department using valence API, I am sending the data to route:/d2l/api/lp/1.12/orgstructure/ and the data I am sending is the following:

{"Type":101,

"Name":"Test",

"Code":"TestCode",

"Parents":[{"number":6606}]

}

But I keep getting the following:

"{\"Errors\":[{\"Message\":\"Parents list cannot be empty.\"}]}"

 

 

Tagged:

Answers

  • Justin.S.508
    Justin.S.508 Posts: 4
    edited November 2022

    Hi @Haseeb Ahmad​,

     

    As a starting point, I think the "Parents" array is meant to just have comma-separated org-unit IDs and not a JSON object. Try changing it to this, and see if your problem persists:

    "Parents": [6606]

     

    Hope this helps!