How to attach URLs to a row using the Node.js SDK?

Options
System
System Employee Admin
This discussion was created from comments split from: Attach File or URL to Row - Request Body for cURL or Python.

Answers

  • Josh Rosenfeld
    edited 05/30/24
    Options

    Has anyone figured out how to attach URLs to a row using the Node.js SDK? More specifically, does anyone know the addRowUrlAttachment method request body? I understand a sheetId and rowId are needed, but there's no documentation that shows the rest of the syntax. The Smartsheet API docs only show an example using the addRowFileAttachment method, which is not what I'm looking for.

  • karthick
    karthick ✭✭✭
    Options

    Hi @Josh Rosenfeld Have done to attach URL to a row in python script and not in nodejs. Might be syntax will be differ and kindly refer the below code.

    you have create an attachment object model by using attachment type as "LINK"

    attachment_url - it should be your URL
    
                    # Create an Attachment object
    attachment = smartsheet.models.Attachment({
    'attachmentType': "LINK",
    'url': attachment_url
    })

    # Attach the URL to the row
    attachment_result = ss_client.Attachments.attach_url_to_row(sheet_id,row.id,attachment)