I have found this piece of code to update cell in SmartSheet website. But I I don't understand what are the values in the fields variable. Is anyone has the working example of PHP code to do this?
curl https://api.smartsheet.com/2.0/sheets/{sheetId}/rows?include=objectValue \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-X PUT \
-d '[{"id": "6572427401553796", "cells": [{"columnId": 7518312134403972,"objectValue": {"objectType": "PREDECESSOR_LIST","predecessors": [{"rowId": 567735454328708,"type": "FS","lag": {"objectType": "DURATION","days": 2,"hours": 4}}]}}]}]'
My current php code is as follow and I just want to update some value into the sheet.I don't know what to put in the field varaible. Thanks.
<?php
$baseURL = "https://api.smartsheet.com/2.0";
$getSheetURL = $baseURL. "/sheets/4925037959505xxx/rows?include=objectValue";
$accessToken = "34ouqtkxp0sutdv6tjbwtsxxxx";
$headers = array("Authorization: Bearer ". $accessToken , "Content-Type: application/json");
$fields='[????]';
$ch = curl_init($getSheetURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
$result = curl_exec($ch);
print_r($result);
?>
Thanks