Any way to batch-create Discussions (sheet or row) using the API?

sgolux
sgolux ✭✭✭
edited 08/24/22 in API & Developers

I see in the documentation two APIs for adding a discussion to a sheet or a row:

  • POST https://api.smartsheet.com/2.0/sheets/{sheetId}/discussions
  • POST https://api.smartsheet.com/2.0/sheets/{sheetId}/rows/{rowId}/discussions

In both cases, this seems to be a single API invocation that adds a single discussion to a single sheet or row.

Is there any more efficient way to use add multiple discussions to the same sheet (or row) entities with a single API call, or even to add multiple discussions to the same sheet AND to multiple rows on the same sheet? This is especially important given that the API does not allow update requests to the same sheet from the same API token at the same time.

Best Answer

Answers

  • Hi @sgolux

    You are correct that these POST requests add a single discussion to a single sheet/row.

    To add multiple discussions, you would need to loop your requests; you can't reference a discussion that doesn't exist, so this needs to be done sequentially.

    Cheers,

    Genevieve

    Join us at Smartsheet ENGAGE 2024 🎉
    October 8 - 10, Seattle, WA | Register now

  • sgolux
    sgolux ✭✭✭

    Thanks @Genevieve P. - but I think I may have been unclear on phrasing my question. I don't need to reference a discussion that doesn't exist. I am not talking about adding comments to a discussion, which would require that.

    I am talking about adding more than one completely independent discussion at a time. For which I don't need a reference, I just need the reference to the sheet (or row) to which I may want to add more than one discussion.

    Is that possible?

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    Hi @sgolux

    Thanks for clarifying! No, this currently isn't possible, you would need to loop your requests. Even if that's to add multiple, independent discussions to the same row.

    Join us at Smartsheet ENGAGE 2024 🎉
    October 8 - 10, Seattle, WA | Register now