Adding a new item to an iSheet

27223

Hi all,

Apologies for what is probably a basic question, but I've been trying (and repeatedly failing) to use the API to add a new item to a very simple test iSheet. 

The Swagger sample XML and JSON both contain a huge number of fields without specifying which are mandatory, and apparently (per another post on this board) the Swagger samples aren't entirely accurate.  So I pieced together both an XML and a JSON (just to try both) based on some of the other content that I've been able to locate on this site.  Unfortunately, nothing seems to work.  When I attempt to use the Swagger and click "Execute", the Swagger does nothing (presumably because the body field isn't properly formatted).  When I try to add an item directly (without using the Swagger), I get a 500 "Internal Server Error" response.

I have successfully created a new Wiki on this same test site using almost the exact same method (both via the Swagger and otherwise), so I'm confident that this isn't an access/permissions issue.

My JSON is pasted below.  I have only a single text column in this iSheet, and I'm trying to enter the string "GreatTestValue123" into that column.  I am posting to the. . . ./api/3/isheet/[iSheet Number

{

    "data": {

      "item":[

        {

          "itemsequence":1,

          "alerteroption":1,

          "column": [

            {

              "attributecolumnid":1907,

              "rawdata": {

                "value":"GreatTestValue123"

              }

            }

          ]

        }

      ]

    }

}

]]>
Parents
  • Sean Pillai, forget using the insert iSheet items endpoint in Swagger - it doesn't work for JSON. As you point out, it doesn't submit with the JSON you provided. Remove the "data" key so that "item" is root instead and it will submit, only for Collaborate to return a 400 (request invalid) [emoticon:79b09143209a47198626541757c5862f

    .

    Your JSON is correct given:

    1. Your iSheet ID is valid in the API endpoint call
    2. Your column ID (1907) is valid for that iSheet and is either Single or Multiline text
    3. Column 1907 is your only mandatory field, or you have none for that iSheet.

    I would use the curl statements displayed in the Swagger UI, in Postman or similar instead where you can build up more of a suite of go-to example calls.

    ]]>
Reply
  • Sean Pillai, forget using the insert iSheet items endpoint in Swagger - it doesn't work for JSON. As you point out, it doesn't submit with the JSON you provided. Remove the "data" key so that "item" is root instead and it will submit, only for Collaborate to return a 400 (request invalid) [emoticon:79b09143209a47198626541757c5862f

    .

    Your JSON is correct given:

    1. Your iSheet ID is valid in the API endpoint call
    2. Your column ID (1907) is valid for that iSheet and is either Single or Multiline text
    3. Column 1907 is your only mandatory field, or you have none for that iSheet.

    I would use the curl statements displayed in the Swagger UI, in Postman or similar instead where you can build up more of a suite of go-to example calls.

    ]]>
Children
No Data