0

I have been working on a simple production management process based around smartsheet. The code that I have been running has been working fine on my Ubuntu machine, then I copied it over to my Parrot Linux machine running the same node version and it won't find a row that exists. Below is the request:

      var copyRow = {
        "rowIds": artToProdRowsToCopy,
        "to": {
          "sheetId": productionId
        }
      };

      // Set options
      var options = {
        sheetId: artId,
        body: copyRow,
        queryParameters: {
          include: "all"
        }
      };
      console.log(options);
      // Copy the normal engraved rows from art to production
      smartsheet.sheets.copyRowToAnotherSheet(options)
        .then(function(results) {
          callback1(null, results);
        })
        .catch(function(error) {
          console.log(error);
        });

The log output of options:

{ sheetId: 8129017524546436,
  body: 
   { rowIds: [ 8886954296800644 ],
      to: { sheetId: 6941481487333252 } },
   queryParameters: { include: 'all' } }

The error:

{ statusCode: 404,
  errorCode: 1006,
  message: 'Not Found',
  refId: 'zjl2z56296l9' }

I'm running node v8.9.1, on Parrot Linux 3.9.

I've checked that each of these sheet and row ID #'s are correct and they all are (the ones in the examples are not real however). Any help would be appreciated.

Edit: Adding debug info:

[Smartsheet] 2017-11-20T20:22:55.876Z[   INFO] POST https://api.smartsheet.com/2.0/sheets/8129017124546436/rows//copy?include=all
[Smartsheet] 2017-11-20T20:22:55.876Z[VERBOSE] Request Payload (preview): {"rowIds":[2759271070885764,3212501789763460,4576920289470340,8982631438149508,2962733838690180,8886959296800644],"to":{"sheetId":6941441487333252}}
[Smartsheet] 2017-11-20T20:22:55.876Z[  DEBUG] Request Payload (full): {"rowIds":[2759271070885764,3212501789763460,4576920289470340,8982631438149508,2962733838690180,8886959296800644],"to":{"sheetId":6941441487333252}}
[Smartsheet] 2017-11-20T20:22:56.155Z[  ERROR] Request failed after 0 retries
[Smartsheet] 2017-11-20T20:22:56.156Z[  ERROR] POST https://api.smartsheet.com/2.0/sheets/8129017124546436/rows//copy?include=all
[Smartsheet] 2017-11-20T20:22:56.156Z[  ERROR] Response: Failure (HTTP 404)
Error Code: 1006 - Not Found
Ref ID: 85bn0m2j8oki
Adam
  • 15
  • 4

3 Answers3

1

I don't see any obvious issues with your request structure. Typically, the 404 Not Found error is related to an issue with the request URI, rather than the contents of the request itself. i.e., a 404 Not Found error means that, for some reason or another, the request URI is not reachable.

The URI for the Copy Row(s) request is:

POST /sheets/{sheetId}/rows/copy

A few troubleshooting suggestions:

  • Verify that the casing of all characters in the request URI are lowercase.

  • Verify that the sheet corresponding to the sheetId value in the request URI exists.

  • Verify that the user who owns the API Access token that you're specifying in the Authorization header of the Copy Row(s) API request does indeed have access to the sheet corresponding to the sheetId value in the request URI.

As described in the Troubleshooting section of the API docs, I'd suggest that you use a tool like Fiddler or Charles HTTP Proxy to examine the raw HTTP request that your app is sending, then you can investigate/verify the items I've listed above.

Update #1

Thanks for updating your post with debugging info. Based on that, it looks like your request URI contains an extra slash between the words rows and copy:

POST https://api.smartsheet.com/2.0/sheets/8129017124546436/rows//copy?include=all

Perhaps this is causing your problem?

Update #2

I've been able to reproduce the Not Found error in Postman if my Request URI contains two slashes between the words rows and copy(like your debug output shows). Removing one of these slashes fixes the issue. That is, your request should look like this (only one slash between the words rows and copy).

POST https://api.smartsheet.com/2.0/sheets/8129017124546436/rows/copy?include=all
Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • I just added what the debugging looks like. – Adam Nov 20 '17 at 20:25
  • Working on getting Node to except the self signed Charles cert . I'll let you know if I find anything more. – Adam Nov 20 '17 at 20:41
  • I've updated my answer to include more info, based on the debug output you've added to your post. – Kim Brandl Nov 20 '17 at 20:57
  • Added "Update #2" to my answer to provide more info. If this resolves your issue, please mark this answer as "Accepted" so that others may benefit from this info in the future. Thanks! – Kim Brandl Nov 20 '17 at 22:02
  • Just marked it. Sorry about the delay and thanks for your assistance. – Adam Nov 21 '17 at 01:43
0

Looks like our SDK bug. Stay tuned for a fix.

Steve Weil
  • 863
  • 5
  • 8
0

Fixed in version 1.0.3 - now on Github and npm.

https://www.npmjs.com/package/smartsheet https://github.com/smartsheet-platform/smartsheet-javascript-sdk/releases/tag/v1.0.3

Steve Weil
  • 863
  • 5
  • 8