Updating Column In Smartsheets Through Python API

Hello!

I am trying to update a column in a specific smartsheet using the update_column method from the Python SDK. I keep getting the error:

{"response": {"statusCode": 400, "reason": "Bad Request", "content": {"errorCode": 1032, "message": "The attribute(s) column.id are not allowed for this operation."}

But, if I set the column.id property to None, it says that the Column ID cannot be None.

Any thoughts?

Answers

  • David Jasven
    David Jasven ✭✭✭✭

    Based on the error message you're encountering, it seems like you're trying to update a column by specifying its ID in the body of your request, which is not allowed for this operation as indicated by the error code 1032 in the Smartsheet API documentation. To update a column in Smartsheet using the Python SDK, you should not include the column.id attribute in the request body you're sending.

    However, it's important to note that to identify which column you want to update, you still need to specify the column ID in the URL of your API call, not in the body. The API call typically looks like this: PUT /sheets/{sheetId}/columns/{columnId}. This means you use the column ID in the path to specify which column to update, but you don't include the column.id in the JSON body of your request.

    For updating a column without encountering the "Column ID cannot be None" error, ensure that you are correctly specifying the column ID in the endpoint URL and not in the request body. Your request body should include only the attributes of the column that you are allowed to update, such as title, index, type, etc., depending on what changes you are trying to make to the column.

    If you are still encountering issues, it might be helpful to review the specific attributes that are allowed in the request body for the update_column method in the API documentation or SDK documentation to ensure your request is formatted correctly.