Why is permalink not included in response?

John Rainbolt
edited 02/07/24 in API & Developers

I'm hitting the Smartsheet API with:

METHOD:
POST

URL:
https://api.smartsheet.com/2.0/sheets/12345/rows?include=rowPermalink

REQUEST BODY:
[
    {
        "cells": [
            {
                "columnId": 11111,
                "value": "Random Text"
            },
            {
                "columnId": 22222,
                "value": 1
            }
        ]
    }
]

I get back a success response that includes an array of row objects. The documentation states that each row object should include a permalink "if the include query string parameter contains rowPermalink." I believe I have done that (see include=rowPermalink in my query string above), but the row objects still do not include a permalink.

Here is the response I get back:

{
    "message": "SUCCESS",
    "result": [
        {
            "cells": [
                {
                    "columnId": 00000
                },
                {
                    "columnId": 11111,
                    "displayValue": "Random Text",
                    "value": "Random Text"
                },
                {
                    "columnId": 22222,
                    "displayValue": "1",
                    "value": 1.0
                }
            ],
            "createdAt": "2024-02-07T14:51:28Z",
            "expanded": true,
            "id": 67890,
            "locked": false,
            "lockedForUser": false,
            "modifiedAt": "2024-02-07T14:51:28Z",
            "rowNumber": 76,
            "sheetId": 12345,
            "siblingId": 33333
        }
    ],
    "resultCode": 0,
    "version": 76
}

This code has been running in production for about a year now, and has been successfully pulling out permalinks the entire time. It started failing in the last hour, and I can't think of anything I changed today or recently. I should mention that when the permalink was included, it was included as "permalink", not "permaLink" as the documentation shows. Just a minor documentation issue, not relevant to my issue where the field is missing entirely.

What am I doing wrong?

Edit: After additional testing, I found that I can still retrieve the permalink via a follow-up GET request for the row I just created. It's a hacky workaround, and I would still like to know if I'm doing something wrong in the initial request.

Answers

  • Lee Joramo
    Lee Joramo ✭✭✭✭✭✭

    At first, I thought this should work, but it didn't for me either. I also tried adding the query string as part of the JSON as I do in the javascript SDK

    {
        "queryParameters": {
            "include": "rowPermalink"
        },
        "toTop": true,
        "cells": [
            ... // cells
        ]
    }
    

    which didn't work either.

    Looking at my own code base, I use the same pattern as you mentioned, and make an additional GET request.