API & Developers

API & Developers

Connect with other developers from around the world and collaborate on ideas using the Smartsheet API.

Adding a row via API using cURL adds blank row

Hi all:

I'm attempting to add a child row to a sheet using the API and cURL. It took some time but finally, taking information from chatgpt and other sources, I was able to get a row added as a child in the proper place. However, the row is blank and not taking the values I am setting.

curl -X POST https://api.smartsheet.com/2.0/sheets/3571298173144964/rows -H "Authorization: Bearer <TOKEN> " -H "Content-Type: application/json" -d "{\"parentId\":525015721938820,\"rows\": [{ \"cells\": [ {\"columnId\": 4063440565129092, \"Value\": \"Child\"}]}]}"

is setting a child row to the parent as expected, but all cells are blank.

Any ideas what is wrong with the value set?

Thanks

Answers

  • Employee

    Hi @ser72,

    I noticed that you opened a Support ticket about this, and I can see that’s now resolved. Would you be able to post the solution here to help other members reviewing this thread? 

    Thanks,

    Georgie

    Need more information? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

  • edited 01/23/25

    I am having the same problem and have not found a solution. @ser72 did you figure this out?

    Edit: Disregard, I found I was using the 'rows' in my json which you dont need when adding a new row. Just the cells element.

  • I didn't end up using this but it was something like:

    curl -X POST https://api.smartsheet.com/2.0/sheets/3571298173144964/rows -H "Authorization: Bearer <TOKEN> " -H "Content-Type: application/json" -d "{"parentId":525015721938820: [{ "cells": [ {"columnId": 4063440565129092, "Value": "Child"}]}]}"

Trending in API & Developers