Smartsheet Connector
Documentation
Version: 1
Documentation

Smartsheet Connector - Source Code


<?xml version="1.0" encoding="utf-8"?>
<ApiConfig Name="Smartsheet" 
           Slug="smartsheet-connector" 
           Id="761db6ac-b329-4e8f-9bc7-75e244f1803f" 
           Version="1"
           EngineVersion="16"
           Desc="Read / write SmartSheet data inside your app, perform many SmartSheet operations such as Read, Update, Delete, List, Search, Export on objects like Sheets, Rows, Users etc without coding using easy to use high performance API Connector"
           HelpLink="https://smartsheet.redoc.ly/#section/Introduction"
           Logo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfoAgEOOQ2OFNtHAAAVDklEQVR42u2df5hcVXnHP++9s5ssCSEYwk9Fqq1Im90oCkXbqkCxYBElSCYCUUCB0kJQCggPEBUKFaRCNE8U+hgeVIRAolShKlB+SCkmKUJ2+REkEJIg0JAQkmyy2d255+0f597Z3WR/3J05M3dm9nweHsKSmTPn3P3OOe95z3veFzwej8fjGdOIk1ba8qBAkPVwPE5YsajsJnKOu7Q3MBErM099EQAbgbddNOZIWAKGgICvAzOAQkYPx1MaIejTKF9FakpYgIkUwj2BfTN6OJ7SeQpkLsILGDeLjRthiYAqgMnu2XhKZCnol4FniAwEbgxldzOWm22Ap6roUpQzgecIm4ACrLjTScuujXdP/fA7lC+BPIfmwPTAirucNe4dBGOTWFQ8R5iDwK2owJWwlMTG8tQ+S4uiag6hUHAuKnAmLOPN9vpgKarWpmoGuiPocGNT7Yw7G8tPWLXOctAvITxHLoLuEDpiD3vbLLviCH2/x47yvO/exhobtANngzxL2AQ9Yd9M9YG8/VMElAkIoYsP9MJqfF5A9WzQp6EAUc/A5c8k05TujcgcRCYQlO878sJqbF5C9WxElmIADQca6m15QEFpArkc4QQcWcsOheWNr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KITIR5EngJZQXEV4AXYWyDthIGHRhtO/GtAAmwjsoGxNHxntgUJ0L2o3RTnJBtEssaRRn4/Xb/zGBA2EJ9PmWrA8pEZXxW3+Px+PxeDxjkv8HgQoTM7WvMM4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMDItMDFUMTQ6NTY6NTIrMDA6MDB0YSo6AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTAyLTAxVDE0OjU2OjUyKzAwOjAwBTyShgAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0wMi0wMVQxNDo1NzoxMyswMDowMJ/W3SkAAAAASUVORK5CYII="
>
    <VersionHistory>
        <Change Date="2024-08-26">Initial version</Change>
    </VersionHistory>
    
    <ServiceUrls>
        <ServiceUrl Name="https://api.smartsheet.com/2.0" Url="https://api.smartsheet.com/2.0" />
    </ServiceUrls>
    
    <Auths>
        <Auth Name="OAuth" Label="OAuth (Dynamic Token)" Type="OAuth" ConnStr="ScopeSeparator={space};AuthorizeInFullBrowser=True;ReturnUrl=https://zappysys.com/oauth;AuthUrl=https://app.smartsheet.com/b/authorize;TokenUrl=https://api.smartsheet.com/2.0/token;Scope=[$Scope$];UseCustomApp=True;"
              TestEndPoint="get_sheets"
              HelpLink="https://smartsheet.redoc.ly/#section/OAuth-Walkthrough">
                <Params>
                    <Param Name="ClientId" Required="True"/>
                    <Param Name="ClientSecret" Required="True" Secret="True" />
                    <Param Name="Scope"
                            Required="True"
                            Options="ADMIN_SHEETS~ADMIN_SIGHTS~ADMIN_USERS~ADMIN_WEBHOOKS~ADMIN_WORKSPACES~CREATE_SHEETS~CREATE_SIGHTS~DELETE_SHEETS~DELETE_SIGHTS~READ_CONTACTS~READ_EVENTS~READ_SHEETS~READ_SIGHTS~READ_USERS~SHARE_SHEETS~SHARE_SIGHTS~WRITE_SHEETS" 
                            MultiSelectSeparator="{SPACE}"
                            MultiSelect="True"
                            Value="READ_SHEETS~WRITE_SHEETS"
                            Desc="Scopes you want to work with."
                            Example="READ_SHEETS~WRITE_SHEETS"
                            HelpLink="https://smartsheet.redoc.ly/#section/Authentication" />                    
                    
                    <!-- Retry parameters -->
                    <Param Name="RetryMode" Value="RetryWhenStatusCodeMatch" Options="None;RetryAny;RetryWhenStatusCodeMatch;"  Hidden="True" />
                    <Param Name="RetryStatusCodeList" Value="429|503" Hidden="True" />
                    <Param Name="RetryCountMax" Value="5" Hidden="True" />
                    <Param Name="RetryMultiplyWaitTime" Value="True" Hidden="True" />
                </Params>
                <Notes>
                    <![CDATA[                    
<h2>OAuth Walkthrough</h2>
<p>Apps connect to Smartsheet using <a href="https://oauth.net/2/" target="_blank">OAuth 2.0</a> to authenticate and authorize users. If you are building an app, this documentation will walk you through the steps you need to authenticate your users. The Smartsheet SDKs contain APIs for OAuth 2.0.</p>
<p><em>NOTE: For users of apps like AWS AppFabric, you will need a Tenant ID. You can find your Tenant ID in Admin Center under Security & Controls. There is a Smartsheet Tenant ID pane.</em></p>

<h3>First Steps</h3>  
<p>Before you can start using OAuth 2.0 with your app, Smartsheet needs the following information:</p>
<ol>
    <li>You must <a href="https://developers.smartsheet.com/register" target="_blank">register</a> with Smartsheet to get a developer account*. The developer account gives you access to "Developer Tools", which is where you manage your app.</li>
    <li>In "Developer Tools", complete any required fields in your developer profile.</li>
    <li>In "Developer Tools", register your app so Smartsheet can assign a client Id and a client secret to the app.</li>
    <li>Review the list of access scopes. You'll need to choose which ones your app needs to get to a user's Smartsheet data, and then ask the user to consent to that access.</li>
    <li>After you've worked through these steps, you'll be ready to implement the <a href="https://smartsheet.redoc.ly/#section/OAuth-Walkthrough/OAuth-Flow" target="_blank">OAuth Flow</a>.</li>
</ol>

<h3>Open Developer Tools</h3>
<ol>
    <li>Log in to Smartsheet with your developer account.</li>
    <li>Click the "Account" button in the lower-left corner of your Smartsheet screen, and then click "Developer Tools".</li>
    <li>Do one of the following:
        <ul>
            <li>If you need to register an app, click "Create New App".</li>
            <li>If you need to manage an app, click "view/edit" for the app.</li>
        </ul>
    </li>    
</ol>

<h3>Register Your App Using Developer Tools</h3>
<ol>
    <li>Log in to Smartsheet with your developer account.</li>
    <li>Click the "Account" button in the upper-right corner of your Smartsheet screen, and then click "Developer Tools".</li>
    <li>In the "Create New App" form, provide the following information:
        <ul>
            <li>Name: the name the user sees to identify your app</li>
            <li>Description: a brief description intended for the user</li>
            <li>URL: the URL to launch your app, or the landing page if not a web app</li>
            <li>Contact/support: support information for the user</li>
            <li>Redirect URL: also known as a callback URL. The URL within your application that will receive the OAuth 2.0 credentials After you click "Save", Smartsheet assigns a client Id and secret to your app. Make a note of these Ids for the next steps; however, you can always look them up again in "Developer Tools".</li>
        </ul>    
    </li>
</ol>     
]]>
                </Notes>
        </Auth>

        <Auth Name="Token"
			  Label="Static Token"
              Type="HTTP"
              ConnStr="ScopeSeparator={space};CredentialType=Token"
              TestEndPoint="get_sheets"
              HelpLink="https://smartsheet.redoc.ly/#section/API-Basics/Raw-Token-Requests">
              <Params>
                   <Param Name="Password"
                          Label="Access Token"
                          Required="True"
                          Secret="True" />

                  <!-- Retry parameters -->
                   <Param Name="RetryMode"
                          Value="RetryWhenStatusCodeMatch"
                          Options="None;RetryAny;RetryWhenStatusCodeMatch;"
                          Hidden="True" />
                   <Param Name="RetryStatusCodeList" Value="429|503" Hidden="True" />
                   <Param Name="RetryCountMax" Value="5" Hidden="True" />
                   <Param Name="RetryMultiplyWaitTime" Value="True" Hidden="True" />
              </Params>
              <Notes>
                <![CDATA[                    
<div>
    <h2 href="/#section/API-Basics/Raw-Token-Requests"></a>Raw Token Requests</h2>
</div>
<div>
    <p>If you want to get started quickly, or are developing a standalone application that can run with your credentials, follow these instructions:</p>
    <ol>
        <li>Click the "Account" button in the lower-left corner of the Smartsheet screen, and then click "Personal Settings".</li>
        <li>Click the "API Access" tab.</li>
        <li>Click the "Generate new access token" button to obtain an access token.</li>
    </ol>
    <p>The access token must be sent with every API call in an HTTP authorization header (except for therequests to Get Access Token or Refresh Access Token). Once you have an access token, include it in the
        <strong>Authorization</strong> header for every request you make:</p>
    <p><code>Authorization: Bearer JKlMNOpQ12RStUVwxYZAbcde3F5g6hijklM789</code></p>
    <p>
       The header name is <strong>Authorization</strong> and the value of the header is <strong>Bearer JKlMNOpQ12RStUVwxYZAbcde3F5g6hijklM789</strong>. 
       Since the access token is being transmitted in clear text, all API calls are done over HTTPS.
    </p>
    <p>NOTE: A best practice is to use a shared account, such as <a href="mailto:ticket-processor@example.com">ticket-processor@example.com</a>, rather than your individual work account.</p>
</div>
]]>
            </Notes>
        </Auth>
    </Auths>

    <Template>
		<Param Name="T_IdParam"
			IsKey="True"
			ReadAs="Id"
			Functions="{$rows$}"
			DataType="DT_I8"
			Desc="Restrict results to records specified by a comma-separated list of IDs. Max IDs per request controlled by BatchSize property (found in Pagination template)" />
        
		<Param Name="T_DateTime" Options="2020-01-30T13:25:32;2020-01-30;now;today;yesterday;monthstart;monthend;yearstart;yearend;weekstart;weekend;yearstart-1y;yearend-1y;monthstart-1d;monthend+1d;today-24h;now-24h;now-1d;today+7d;" 
			ValueTemplate="&lt;&lt;{$value$}|||yyyy-MM-ddTHH:mm:ss,FUN_TO_DATETIME&gt;&gt;" />
			
        <EndPoint Name="T_Pagination" RequestFormat="Csv" BatchSize="100">
            <Params>
                <Param Name="PageSize" Key="pageSize" Type="Query" Value="1000" />
                <Param Name="PagingMode" Type="Property" Value="ByUrlParameter" />
                <Param Name="PagingByUrlAttributeName" Type="Property" Value="page" />
                <Param Name="PagingMaxRowsExpr" Type="Property" Value="$.totalRowCount" />
                <Param Name="PagingMaxRowsDataPathExpr" Type="Property" Value="$.rows[*]" />
            </Params>
        </EndPoint>

        <EndPoint Name="T_PaginationData" RequestFormat="Csv" BatchSize="100">
            <Params>
				<Param Name="PageSize" Key="pageSize" Type="Query" Value="100" />
                <Param Name="PagingMode" Type="Property" Value="ByUrlParameter" />
                <Param Name="PagingByUrlAttributeName" Type="Property" Value="page" />
                <Param Name="PagingMaxRowsExpr" Type="Property" Value="$.totalCount" />
                <Param Name="PagingMaxRowsDataPathExpr" Type="Property" Value="$.data[*]" />
            </Params>
        </EndPoint>	
	
        <EndPoint Name="T_CoreOutputColumns">
            <OutputColumns>
                <Column Name="id" DataType="DT_I8" Label="Id"  />
                <Column Name="createdAt" DataType="DT_DBTIMESTAMP" Label="CreatedAt" />
                <Column Name="modifiedAt" DataType="DT_DBTIMESTAMP" Label="ModifiedAt" />
				<Column Name="createdAt" DataType="DT_DBTIMESTAMP" Label="CreatedAtLocalTime" Functions="TO_LOCAL_DATETIME"/>
				<Column Name="modifiedAt" DataType="DT_DBTIMESTAMP" Label="ModifiedAtLocalTime" Functions="TO_LOCAL_DATETIME"/>				
            </OutputColumns>
        </EndPoint>
		
        <EndPoint Name="T_SheetRowsOutputColumnsInsertOrUpdate" Template="T_CoreOutputColumns">
            <OutputColumns>		
				<Column Label="RowNumber" Name="rowNumber" DataType="DT_I4" />
				<!-- We have to use [Name="result"] below, because Nayan was a bad, bad boy! Or maybe just lazy! 
					 "result" is an existing field in the JSON response, otherwise "ValueTemplate" would not work -->
				<Column Label="BatchMessage" Name="P_message" DataType="DT_WSTR" />
				<Column Label="BatchFailedItems" Name="P_failedItems" DataType="DT_NTEXT" />
				<Column Label="BatchResultCode" Name="P_resultCode" DataType="DT_I4" />
				<Column Label="Version" Name="P_version" DataType="DT_I4" />
				<Column Label="HttpStatusCode" Name="ResponseHeaders_StatusCode" DataType="DT_I4" />		
				<Column Label="PrevRowId" Name="siblingId" DataType="DT_I8" />		
            </OutputColumns>
        </EndPoint>
		
        <EndPoint Name="T_SheetRowsOutputColumnsDelete">
            <OutputColumns>		
			    <Column Label="Id" Name="result" DataType="DT_I8"  />
				<Column Label="BatchMessage" Name="P_message" DataType="DT_WSTR" />
				<Column Label="BatchResultCode" Name="P_resultCode" DataType="DT_I4" />
				<Column Label="HttpStatusCode" Name="ResponseHeaders_StatusCode" DataType="DT_I4" />			
            </OutputColumns>
        </EndPoint>		
		
        <EndPoint Name="T_SheetOutputColumns" Template="T_CoreOutputColumns">
            <OutputColumns>
                <Column Name="name" DataType="DT_WSTR" Label="Name" Length="255" />			
                <Column Name="accessLevel" DataType="DT_WSTR" Label="AccessLevel" Length="50" />
                <Column Name="permalink" DataType="DT_WSTR" Label="Permalink" Length="2048"/>
            </OutputColumns>
        </EndPoint>		

        <EndPoint Name="T_SheetRowsOutputColumns" Template="T_CoreOutputColumns">
			<Params>
                <Param Name="SheetId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"/>
					   
                <Param Name="RowsModifiedSince"
				       Label="Rows Modified Since"
                       Key="rowsModifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   />
                <Param 
                       Name="Exclude"
                       Key="exclude"
                       Type="Query"
					   Desc="A comma-separated list of optional elements to not include in the response: 
filteredOutRows - excludes filtered out rows from response payload if a sheet filter is applied; includes total number of filtered rows
linkInFromCellDetails - excludes the following attributes from the cell.linkInFromCell object: columnId, rowId, status
linksOutToCellsDetails - excludes the following attributes from the cell.linksOutToCells array elements: columnId, rowId, status
nonexistentCells - excludes cells that have never contained any data"
						Options=";filteredOutRows;linkInFromCellDetails;linksOutToCellsDetails;nonexistentCells"
						MultiSelect="True"
						MultiSelectSeparator=","
					   />
					   
                <Param Name="Include"
                       Key="include"
                       Type="Query"
					   Desc="A comma-separated list of optional elements to include in the response:
attachments - includes the metadata for sheet-level and row-level attachments. To include discussion attachments, both attachments and discussions must be present in the include list.
columnType -includes columnType attribute in the row's cells indicating the type of the column the cell resides in.
crossSheetReferences - includes the cross-sheet references
discussions - includes sheet-level and row-level discussions. To include discussion attachments, both attachments and discussions must be present in the include list.
filters - includes filteredOut attribute indicating if the row should be displayed or hidden according to the sheet's filters.
filterDefinitions - includes type of filter, operators used, and criteria
format - includes column, row, cell, and summary fields formatting.
ganttConfig - includes Gantt chart details.
objectValue - when used in combination with a level query parameter, includes the email addresses for multi-contact data.
ownerInfo - includes the owner's email address and the owner's user Id.
rowPermalink - includes permalink attribute that represents a direct link to the row in the Smartsheet application.
source - adds the Source object indicating which report, sheet Sight (aka dashboard), or template the sheet was created from, if any.
writerInfo - includes createdBy and modifiedBy attributes on the row or summary fields, indicating the row or summary field's creator, and last modifier."

						Options=";attachments;columnType;crossSheetReferences;discussions;filters;filterDefinitions;format;ganttConfig;objectValue;ownerInfo;rowPermalink;source;writerInfo"
						MultiSelect="True"
						MultiSelectSeparator=","
					   />				
				
			   
                <Param Label="Column Ids (Default=All Columns)"
                       Name="ColumnIds"
                       Key="columnIds"
                       OptionsEndPoint="get_sheet_fields"
					   OptionsEndPointParameters="SheetId=[$SheetId$]"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Title"		
					   
                       Type="Query"
					   Desc="A comma-separated list of column ids. The response contains only the specified columns in the columns array, and individual rows' cells array only contains cells in the specified columns."
					   MultiSelect="True"
					   MultiSelectSeparator=","					   
					   />			   
					   
                <Param Name="ArrayTransformType" Type="Property" Value="TransformComplexTwoDimensionalArray" />
                <Param Name="ArrayTransColumnNameFilter" Type="Property" Value="$.columns[*].title" />
                <Param Name="ArrayTransRowValueFilter" Type="Property" Value="$.cells[*].value" />
			</Params>
            <OutputColumns>
                <Column Name="rowNumber" Label="RowNumber" Desc="Row number" DataType="DT_I4"/>

                <!-- DYNAMIC CUSTOM FIELDS  -->
                <Column Name="=== Dynamic Column ==="
                        Label="[$parent.title$]"
                        DataType="DT_WSTR"
                        Length="2000"
                        Expand="True"
                        DataEndPoint="get_sheet_fields"
                        DataEndPointParameters="SheetId=[$SheetId$];Filter=$.columns[*];ColumnIds=[$ColumnIds$]"
                        ColumnInfoMap="Name=title;DataType=type|NUMBER=systemColumnType(equals:AUTO_NUMBER)"
                        DataTypeMap="DT_DBTIMESTAMP=DATE,DATETIME;DT_WSTR=TEXT_NUMBER;DT_BOOL=CHECKBOX;DT_DBTIME=DURATION;DT_I4=NUMBER"
                />
				<Column Label="PrevRowId" Name="siblingId" DataType="DT_I8" Order="999" />						
            </OutputColumns>
        </EndPoint>
		
		<EndPoint Name="T_SheetRowsInputColumns">
            <InputColumns>
                <!-- DYNAMIC CUSTOM FIELDS NON CHECKBOX  -->
                <Column Name="[$parent.title$]"
                        Label="[$parent.title$]"
                        DataType="DT_WSTR"
                        Length="2000"
                        Expand="True"
                        DataEndPoint="get_sheet_fields"
                        DataEndPointParameters="SheetId=[$SheetId$];Filter=$.columns[?(@.type != 'CHECKBOX')]"
                        ColumnInfoMap="Name=title;DataType=type|NUMBER=systemColumnType(equals:AUTO_NUMBER)"
                        DataTypeMap="DT_DBTIMESTAMP=DATE,DATETIME;DT_WSTR=TEXT_NUMBER;DT_BOOL=CHECKBOX;DT_DBTIME=DURATION;DT_I4=NUMBER"
						Functions="JSONENC;{$value$}|~|{&quot;columnId&quot;: [$parent.id$], &quot;value&quot;: null}|~|{&quot;columnId&quot;: [$parent.id$], &quot;value&quot;: &quot;{$value$}&quot;},IF_NULL"
						Raw="True"
                />
                <!-- DYNAMIC CUSTOM FIELDS CHECKBOX  -->
                <Column Name="==Checkbox Columns ==="
                        DataType="DT_BOOL"
                        Expand="True"
                        DataEndPoint="get_sheet_fields"
                        DataEndPointParameters="SheetId=[$SheetId$];Filter=$.columns[?(@.type == 'CHECKBOX')]"
                        ColumnInfoMap="Name=title;DataType=type"
                        DataTypeMap="DT_BOOL=CHECKBOX;"
						Functions="LOWER;{$value$}|~|{&quot;columnId&quot;: [$parent.id$], &quot;value&quot;: null}|~|{&quot;columnId&quot;: [$parent.id$], &quot;value&quot;: {$value$}},IF_NULL"
						Raw="True"
                />				
            </InputColumns>
        </EndPoint>	
		
		<!-- order of base template must be before this one else fails to locate-->
		<EndPoint Name="T_SheetRowsInputColumnsUpdate" Template="T_SheetRowsInputColumns">
            <InputColumns>
                <Column Name="id"
                        Label="Id"
                        Desc="Row ID"
                        DataType="DT_I8"
						MapToParam="True" Key="True"
                />
            </InputColumns>			
		</EndPoint>
		
        <EndPoint Name="T_ContactOutputColumns">
            <OutputColumns>
				<Column Name="id" DataType="DT_WSTR" Label="Id" Length="255" />			
                <Column Name="name" DataType="DT_WSTR" Label="Name" Length="255" />			
                <Column Name="email" DataType="DT_WSTR" Label="Email" Length="255" />
				<Column Name="firstName" DataType="DT_WSTR" Label="FirstName" Length="255" />			
				<Column Name="lastName" DataType="DT_WSTR" Label="LastName" Length="255" />
            </OutputColumns>
        </EndPoint>					
		
        <EndPoint Name="T_GroupOutputColumns" Template="T_CoreOutputColumns">
            <OutputColumns>
                <Column Name="name" DataType="DT_WSTR" Label="Name" Length="255" />			
                <Column Name="description" DataType="DT_WSTR" Label="Description" Length="1000" />
				<Column Name="owner" DataType="DT_WSTR" Label="Owner" Length="255" />
				<Column Name="ownerId" DataType="DT_I8" Label="OwnerId" />
            </OutputColumns>
        </EndPoint>			
		
		
		<EndPoint Name="T_SendEmail" Method="POST" Body="{$rows$}" AllowParamBindForLayoutMap="True" ContentType="application/json" JsonRowFormat="Multicontent">
			
		  <LayoutMap>
			<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<settings>
  <dataset id="root" readfrominput="True" />
  <map name="subject" src="Subject"  />
  <map name="message" src="Message"  />
  <map name="ccMe" src="CcMe" DataType="Bool" fragment="True"/>
  <map name="format" src="Format"  />  
  <map name="sendTo" src="SendToEmails" fragment="True"  />
  <map name="sendTo" src="SendToGroups" fragment="True"  />
  <map name="formatDetails">
	<map name="paperSize" src="PaperSize"  />	
  </map>  
</settings>
	]]>
		  </LayoutMap>
			<Params>
                <Param Name="Subject" Label="Subject"/>				
                <Param Name="Message" Label="Message" Editor="Multiline"/>
                <Param Name="CcMe" Label="CC Me" Options=";true;false"/>
				<Param Name="Format"
                       Required="True"
                       Options="EXCEL=EXCEL;PDF=PDF;PDF_GANTT=PDF_GANTT"
                       Value="EXCEL"
                />
                <Param Name="PaperSize"
                       Label="Paper Size (Only for PDF)"
                       Options="LETTER;LEGAL;WIDE;ARCHID;A4;A3;A2;A1;A0"
                />    
                <Param Name="SendToEmails"
					   Lable="Send To Email(s)"
                       OptionsEndPoint="get_contacts"
					   OptionsEndPointLabelColumn="Email"
                       OptionsEndPointValueColumn="Email"
					   MultiSelect="True"
					   MultiSelectSeparator=","
					   MultiSelectTemplate="{&quot;email&quot; : &quot;{@value}&quot; }"
					   ValueTemplate="[ {$value$} ]"
					   />        
                <Param Name="SendToGroups"
					   Lable="Send To Group(s)"
                       OptionsEndPoint="get_groups"
					   OptionsEndPointLabelColumn="Name"
                       OptionsEndPointValueColumn="Id"
					   MultiSelect="True"
					   MultiSelectSeparator=","
					   MultiSelectTemplate="{&quot;groupId&quot; : {@value} }"
					   ValueTemplate="[ {$value$} ]"
					   />   	   

            </Params>
            <OutputColumns>
                <Column Name="version" Label="Version" DataType="DT_I4" />
				<Column Name="resultCode" Label="ResultCode" DataType="DT_I4" />				
                <Column Name="message" Label="Message" DataType="DT_WSTR" Length="1000" />
                <Column Name="failedItems" DataType="DT_WSTR" Length="4000" />
            </OutputColumns>		  
		</EndPoint>
		
		<EndPoint Name="T_Export" Method="GET">
            <Params>
                <Param Name="Format"
                       Key="Accept"
                       Required="True"
                       Type="Header"
                       Options="Excel=application/vnd.ms-excel;PDF=application/pdf;CSV=text/csv"
                       Value="application/vnd.ms-excel"
                />
                <Param Name="PaperSize"
                       Label="Paper Size (Only for PDF)"
                       Key="paperSize"
                       Type="Query"
                       VisibleIf="Format==application/pdf"
                       RequiredIf="Format==application/pdf"
                       Options="LETTER;LEGAL;WIDE;ARCHD;A4;A3;A2;A1;A0"
                />                     
                
                <!-- downloading part -->
                <Param Name="SaveContentAsBinary"
                       Required="True"
                       Type="Property"
                       Hidden="True"
                       Value="True"
                />                	
					   
                <Param Name="RequestTimeoutMs"
                       Label="Request Timeout (ms)"
                       Type="Property"
                       Desc="Timeout in milliseconds after which download stops"
                       Value="600000"
                />
                <Param Name="FileOverwriteMode"
                       Label="File Overwrite Mode"
                       Type="Property"
                       Value="AlwaysOverwrite"
                       Required="True"
                />
                <Param Label="Target File Path"
                       Name="TargetFilePath"
                       Key="ResponseDataFile"                       
                       Desc="Specify a disk file path to save file to"
                       Required="True"
                       Type="Property"
                       Value=""
                       Editor="FileSave"
                />
                <!-- dummy output -->
                <Param Name="EnableRawOutputModeSingleRow" Type="Property" Value="True" />
            </Params>
            <OutputColumns>
                <Column Name="Id" DataType="DT_WSTR" Length="50" />
                <Column Name="Status" DataType="DT_WSTR" Length="50" />
                <Column Name="TargetFilePath" DataType="DT_WSTR" Length="2000" />
            </OutputColumns>
        </EndPoint>
 
    </Template>

    <EndPoints>
		
		<!-- ====== SEARCH ====== -->
		<EndPoint Name="search" 
                  Template="T_Pagination"
                  Label="Search (cell data or other object types)"
                  Url="/search/[$SheetId$]"
                  Filter="$.results[*]"
                  Method="GET"
                  Desc="Get a list of search result object."
                  CachedTtl="5"
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/list-sheets">  
            <Params>
				<Param Name="Query" Label="Search Query (use double quotes for exact search)" Key="query" Type="Query" Required="True"/>					   			
                <Param Name="SheetId"
                       Type="Placeholder"
					   Lable="Sheet Id for Search (Blank=Everywhere)"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
					   />                
				<Param Name="Scope" Lable="Search Scope (Blank=All Object Types)" 
				       MultiSelect="True" 
					   MultiSelectSeparator=","
					   Value="cellData" 
					   Options="cellData;attachments;comments;folderNames;reportNames;sheetNames;sightNames;summaryFields;templateNames;workspaceNames" 
					   Key="scope" Type="Query"
						/>
                <Param Label="Modified Since"
                       Name="ModifiedSince"
                       Key="modifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   /> 
			</Params>
        </EndPoint>
	
        <!-- ====== LIST SHEETS ====== -->
        <EndPoint Name="get_sheets"
                  Template="T_SheetOutputColumns, T_PaginationData"
                  Label="List Sheets"
                  Url="/sheets"
                  Filter="$.data[*]"
                  Method="GET"
                  Desc="Get a list of Sheets."
                  CachedTtl="5"
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/list-sheets">  
            <Params>
                <Param Label="Modified Since"
                       Name="ModifiedSince"
                       Key="modifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   />  
                <Param Name="Include" Key="include" Type="Query" Options=";sheetVersion;source"/>					   
			</Params>
        </EndPoint>
		
        <!-- ====== GET SHEET FIELDS ====== -->                
        <EndPoint Name="get_sheet_fields"
                  Label="Get Sheet Fields"
                  Url="/sheets/[$SheetId$]?level=0&amp;pageSize=1"
                  Filter="$.columns[*]"
                  Method="GET"
                  Desc="Get Sheet fields by Sheet ID."
                  CachedTtl="5"
				  UseRawCache="True"
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/getSheet">
                  <!-- Url => pageSize=1 because we are actually interested in the "columns" array field,
                              so we are getting the first data row only -->
            <Params>
                <Param Name="SheetId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />

                <Param Label="Column Ids (Default=All Columns)"
                       Name="ColumnIds"
                       Key="columnIds"
                       OptionsEndPoint="get_sheet_fields"
					   OptionsEndPointParameters="SheetId=[$SheetId$]"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Title"		
                       Type="Query"
					   Desc="A comma-separated list of column ids. The response contains only the specified columns in the columns array, and individual rows' cells array only contains cells in the specified columns."
					   MultiSelect="True"
					   MultiSelectSeparator=","					   
					   />			   
					   
                <Param Name="Filter"
                       Type="Property"
                       Options="All columns=$.columns[*];
                                Common columns=$.columns[?(@.type != ''CONTACT_LIST'' &amp;&amp; @.type != ''MULTI_CONTACT_LIST'')];
                                Contact columns=$.columns[?(@.type == 'CONTACT_LIST' || @.type == 'MULTI_CONTACT_LIST')];
								Checkbox only columns=$.columns[?(@.type == 'CHECKBOX')];
								Non checkbox columns=$.columns[?(@.type != 'CHECKBOX')];"
                       Value="$.columns[*]"
                       Required="True"
                />
            </Params>
            <OutputColumns>
				<Column Name="id" DataType="DT_I8" Label="Id" />
				<Column Name="version" DataType="DT_I4" Label="Version" />
				<Column Name="index" DataType="DT_I4" Label="Index" />
				<Column Name="title" DataType="DT_WSTR" Label="Title" Length="100" />
				<Column Name="type" DataType="DT_WSTR" Label="Type" Length="50" />
				<Column Name="width" DataType="DT_I4" Label="Width" />
				<Column Name="systemColumnType" DataType="DT_WSTR" Label="SystemColumnType" Length="100" />                
				<Column Name="contactOptions.name" DataType="DT_WSTR" Label="ContactOptionsName" Length="500" />
				<Column Name="contactOptions.email" DataType="DT_WSTR" Label="ContactOptionsEmail" Length="500" />
				<Column Name="options" DataType="DT_WSTR" Label="Options" Length="500" />
				<Column Name="description" DataType="DT_WSTR" Label="Description" Length="1000" />
				<Column Name="validation" DataType="DT_BOOL" Label="Validation" />
				<Column Name="autoNumberFormat_prefix" DataType="DT_WSTR" Label="AutoNumberFormatPrefix" Length="100" />
				<Column Name="autoNumberFormat_fill" DataType="DT_WSTR" Label="AutoNumberFormatFill" Length="50" />
				<Column Name="autoNumberFormat_suffix" DataType="DT_WSTR" Label="AutoNumberFormatSuffix" Length="100" />			
				<Column Name="format" DataType="DT_WSTR" Label="Format" Length="100" />
				<Column Name="symbol" DataType="DT_WSTR" Label="Symbol" Length="50" />
				<Column Name="primary" DataType="DT_BOOL" Label="Primary" />
				<Column Name="locked" DataType="DT_BOOL" Label="Locked" />
				<Column Name="lockedForUser" DataType="DT_BOOL" Label="LockedForUser" />
				</OutputColumns>
        </EndPoint>
        
        <!-- ====== GET SHEET ROWS ====== -->
        <EndPoint Name="get_sheet_rows"
                  Template="T_SheetRowsOutputColumns,T_Pagination"
                  Label="Get Sheet Rows"
                  Url="/sheets/[$SheetId$]?level=0"
                  Filter="$.rows[*]"
                  Method="GET"
                  Desc="Get Sheet rows by Sheet ID."                  
                  IncludeParentColumns="True" 
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/getSheet"
				  >                      
            <Params>

            </Params>
        </EndPoint>
		
        <!-- ====== GET SHEET ROW BY ID ====== -->
        <EndPoint Name="get_sheet_rows_by_ids"
                  Template="T_SheetRowsOutputColumns"
                  Label="Get Sheet Row by ID(s)"
                  Url="/sheets/[$SheetId$]?rowIds=[$Id$]&amp;level=0"
                  Filter="$.rows[*]"
                  Method="GET"
                  Desc="Get a Sheet by ID(s)."
                  IncludeParentColumns="True"
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/getSheet"
				  RequestFormat="Csv"
				  BatchSize="100"
				  >
            <Params>
                <Param Name="Id"
					   Template="T_IdParam"	
					   Label="Row Id(s) - Comma separated (Blank=All Rows)"
                       Type="Placeholder"                       
                       Descr="Ids of rows to read, separated by a comma (e.g. 5125856468471684,6425856468471685,7125856468471689)"                       
                />
                <Param Name="RowNumber"
					   Label="Row Number(s) - Comma separated list (Blank=All Rows)"
                       Type="Query"
					   Key="rowNumbers"
					   Desc="A comma-separated list of row numbers on which to filter the rows included in the result. Non-existent row numbers are ignored."
					   />						
            </Params>
			<InputColumns>
 				<Column Name="Id" Label="Id" MapToParam="True" DataType="DT_I8" Key="True"/>
 			</InputColumns>			
        </EndPoint>      

        <!-- ====== DELETE ROWS ====== -->
        <EndPoint Name="delete_sheet_rows"
                  Label="Delete Sheet Rows"
                  Url="/sheets/[$SheetId$]/rows?ids=[$Id$]"
                  Method="DELETE"
				  Template="T_SheetRowsOutputColumnsDelete"
                  OutputHeaders="StatusCode"
                  Filter="$.result[*]"
                  Desc="Delete rows from a Sheet by row IDs."
                  HelpLink="https://smartsheet.redoc.ly/tag/rows#operation/delete-rows"                  
				  BatchSize="100"
				  RequestFormat="Csv"
				  IncludeParentColumns="True"
                  >
            <Params>

                <Param Name="SheetId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />
                <Param Name="Id"
					   Template="T_IdParam"	
                       Required="True"
					   Label="Row Id(s) - Comma separated"
                       Type="Placeholder"                       
                       Descr="Ids of rows to delete, separated by a comma (e.g. 5125856468471684,6425856468471685,7125856468471689)"                       
                />
				
				<Param Name="IgnoreRowsNotFound" 
					   Key="ignoreRowsNotFound" Label="Ignore If Rows Not Found" Options=";true;false" Type="Query" 
					   Desc="If set to false and any of the specified row Ids are not found, no rows are deleted, and the 'not found' error is returned."
					   />

            </Params>
            <InputColumns>
                <Column Name="Id" DataType="DT_I8" MapToParam="True" Key="True" />
            </InputColumns>
        </EndPoint>
		
        <!-- ====== ADD ROWS ====== -->
		<EndPoint Name="add_sheet_rows" 
			  Label="Add Sheet Rows"	
			  Desc="Add rows to a Sheet."
              Url="/sheets/[$SheetId$]/rows"
              Method="POST"
			  Template="T_SheetRowsInputColumns, T_SheetRowsOutputColumnsInsertOrUpdate"
              BatchSize="100"
              ContentType="application/json"
              Filter="$.result[*]"
              FailIf="RowsFoundAndNotHandled"
			  OutputHeaders="StatusCode"
              IncludeParentColumns="True"
			  Body="{$rows$}"
              >
		  <Params>
			<Param Name="RowLocation" Label="Add Row at Specific Location (Default=toBottom)" 
				Options="&quot;toBottom&quot;: true;&quot;toTop&quot;: true;&quot;parentId&quot;: 1231234567;&quot;siblingId&quot;: 1231234567;"
				Value="&quot;toBottom&quot;: true"/>
			<Param Name="AllowPartialSuccess" Key="allowPartialSuccess" Label="Allow Partial Success (Default=False)" Options=";false;true" Desc="When specified with a value of true, enables partial success for this bulk operation. See Partial Success for more information."/>
			<Param Name="OverrideValidation" Key="overrideValidation" Label="Override Validation (Default=False)" Options=";false;true" Desc="You may use the query string parameter overrideValidation with a value of true to allow a cell value outside of the validation limits. You must specify strict with a value of false to bypass value type checking."/>
		  </Params>
		 
		  <LayoutMap>
			<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<settings>
  <dataset id="root" readfrominput="True" />
  <map name="id" src="id"  />
  <map name="row_location" hidename="true" fragment="true" value="[$RowLocation,XMLENC$]"  />
  <map name="cells_start" hidename="true" fragment="true" value="&quot;cells&quot;: [ "  />
  <map src="*" hidename="true" fragment="true" skipexpandfor="^(id)$--regex" />
  <map name="cells_end" hidename="true" fragment="true" value=" ] "  />  
    
</settings>
	]]>
		  </LayoutMap>
  
		</EndPoint>	
		
        <EndPoint Name="update_sheet_rows" 
              Url="/sheets/[$SheetId$]/rows"
              Method="PUT"
			  Template="T_SheetRowsInputColumnsUpdate, T_SheetRowsOutputColumnsInsertOrUpdate"
              BatchSize="100"
              ContentType="application/json"
              Filter="$.result[*]"
              FailIf="RowsFoundAndNotHandled"
			  OutputHeaders="StatusCode"
              IncludeParentColumns="True"
			  Body="{$rows$}"
              >
		  <Params>
		  </Params>
		 
		  <LayoutMap>
			<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<settings>
  <dataset id="root" readfrominput="True" />
  <map name="id" src="id"  />
  <map name="cells_start" hidename="true" fragment="true" value="&quot;cells&quot;: [ "  />
  <map src="*" hidename="true" fragment="true" skipexpandfor="^(id)$--regex" />
  <map name="cells_end" hidename="true" fragment="true" value=" ] "  />  
</settings>
	]]>
		  </LayoutMap>

		</EndPoint>		

        <!-- ====== EXPORT SHEET ====== -->
        <EndPoint Name="export_sheet" Template="T_Export"
                  Label="Export Sheet (to PDF, Excel, CSV file)"
                  Url="/sheets/[$SheetId$]"
                  Desc="Export Sheet to CSV, Excel or PDF file."
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/getSheet">
            <Params>
                <Param Name="SheetId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />
                <!-- dummy output -->
                <Param Name="RawOutputDataRowTemplate" Type="Property" Value='{"Id": "[$SheetId$]",    "Status":"Done",    "TargetFilePath":"[$TargetFilePath,FUN_JSONENC$]"}' />
            </Params>
        </EndPoint>

        <!-- ====== EXPORT REPORT ====== -->
        <EndPoint Name="export_report" Template="T_Export"
                  Label="Export Report (to PDF, Excel, CSV file)"
                  Url="/reports/[$ReportId$]"
                  Desc="Export Report to CSV, Excel or PDF file."
                  HelpLink="https://smartsheet.redoc.ly/tag/reports#operation/getReport">
            <Params>
                <Param Name="ReportId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_reports"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />
                <!-- dummy output -->
                <Param Name="RawOutputDataRowTemplate" Type="Property" Value='{"Id": "[$ReportId$]",    "Status":"Done",    "TargetFilePath":"[$TargetFilePath,FUN_JSONENC$]"}' />
            </Params>
        </EndPoint>

        <!-- ====== SEND REPORT as EMAIL====== -->
        <EndPoint Name="send_report_email" Template="T_SendEmail"
                  Label="Send Report via Email (EXCEL, PDF, or PDF_GANTT format)"
                  Url="/reports/[$ReportId$]/emails"
                  Desc="Sends the report as a Excel / PDF attachment via email to the designated recipients."
                  HelpLink="https://smartsheet.redoc.ly/tag/reports#operation/sendReportViaEmail"
				  >
            <Params>
                <Param Name="ReportId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_reports"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />
            </Params>
		
        </EndPoint>		
        <!-- ====== SEND SHEET as EMAIL====== -->
        <EndPoint Name="send_sheet_email" Template="T_SendEmail"
                  Label="Send Sheet via Email (EXCEL, PDF, or PDF_GANTT format)"
                  Url="/sheets/[$SheetId$]/emails"
                  Desc="Sends the sheet as a Excel / PDF attachment via email to the designated recipients."
                  HelpLink="https://smartsheet.redoc.ly/tag/sheets#operation/sendSheetViaEmail"
				  >
            <Params>
                <Param Name="SheetId"
                       Type="Placeholder"
                       Required="True"
                       OptionsEndPoint="get_sheets"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"
                />
            </Params>
		
        </EndPoint>
		
		<!-- ====== LIST REPORTS ====== -->
        <EndPoint Name="get_reports"
                  Template="T_SheetOutputColumns,T_PaginationData"
                  Label="List Reports"
                  Url="/reports"
                  Filter="$.data[*]"
                  Method="GET"
                  Desc="Get a list of reports."
                  CachedTtl="5"
                  HelpLink="https://smartsheet.redoc.ly/tag/reports#operation/getReports">  
            <Params>
                <Param Label="Modified Since"
                       Name="ModifiedSince"
                       Key="modifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   />  
			</Params>
        </EndPoint>
		
		<!-- ====== LIST CONTACT ====== -->
        <EndPoint Name="get_contacts"
                  Template="T_ContactOutputColumns, T_PaginationData"
                  Label="List Contacts"
                  Url="/contacts"
                  Filter="$.data[*]"
                  Method="GET"
                  Desc="Get a list of contacts."
                  CachedTtl="5"
                  HelpLink="https://smartsheet.redoc.ly/tag/contacts#operation/list-contacts">  
            <Params>
                <Param Label="Modified Since"
                       Name="ModifiedSince"
                       Key="modifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   />  
			</Params>
        </EndPoint>
		<!-- ====== LIST CONTACT ====== -->
        <EndPoint Name="get_groups"
                  Template="T_GroupOutputColumns, T_PaginationData"
                  Label="List Groups"
                  Url="/groups"
                  Filter="$.data[*]"
                  Method="GET"
                  Desc="Get a list of groups."
                  CachedTtl="5"
                  HelpLink="https://smartsheet.redoc.ly/tag/groups#operation/list-groups">  
            <Params>
                <Param Label="Modified Since"
                       Name="ModifiedSince"
                       Key="modifiedSince"
                       Type="Query"
                       Template="T_DateTime"					   
					   />  
			</Params>
        </EndPoint>		
		
		<!-- ====== GET CONTACT ====== -->
        <EndPoint Name="get_contact"
                  Template="T_ContactOutputColumns"
                  Label="Get Contacts"
                  Url="/contacts/[$ContactId$]"
                  Method="GET"
                  Desc="Gets the specified contact."
                  HelpLink="https://smartsheet.redoc.ly/tag/contacts#operation/list-contacts">  
            <Params>
                <Param Name="ContactId"
                       Type="Placeholder"
                       Required="True"
                       IsKey="True"
                       ReadAs="Id"				
                       OptionsEndPoint="get_contacts"
                       OptionsEndPointValueColumn="Id"
                       OptionsEndPointLabelColumn="Name"				   
                />			
			</Params>
        </EndPoint>		
    </EndPoints>
    
    <Tables>
        <Table Name="Sheets"
               SelectEndPoint="get_sheets"
			   >
        </Table>
        <Table Name="Contacts"
               SelectEndPoint="get_contacts"
			   LookupEndPoint="get_contact"
			   >
        </Table>
        <Table Name="Groups"
               SelectEndPoint="get_groups"
			   >
        </Table>		
        <Table Name="Reports"
               SelectEndPoint="get_reports"
			   >
        </Table>		
        <Table Name="[$parent.name$]"
               Expand="True"
               SelectEndPoint="get_sheet_rows"
               LookupEndPoint="get_sheet_rows_by_ids"
               InsertEndPoint="add_sheet_rows"
			   UpdateEndPoint="update_sheet_rows"
               DeleteEndPoint="delete_sheet_rows"
               DataEndPoint="get_sheets">
               <Params>
                   <Param Name="SheetId" Value="[$parent.id$]" Hidden="True"/>
               </Params>
        </Table>
    </Tables>

    <Examples>
        <Example Default="True" Group="ODBC" Label="Tables - Sheets">
            <Code><![CDATA[SELECT * FROM Sheets --Where Id='5815807987847055']]></Code>
        </Example>


        <Example Group="ODBC" Label="Tables - Contacts">
            <Code><![CDATA[SELECT * FROM Contacts --Where Id='abcd1234abc']]></Code>
        </Example>		

        <Example Default="True" Group="ODBC" Label="Get sheet rows" Desc="This example shows how to query any Smart Sheet by its name. If you have space in the sheet name or column name then use bracket ( [my name] ) or double quotes (&quot;my name&quot;) around it.">
            <Code><![CDATA[SELECT Id,RowNumber,[Some Column 1],[Some Column 2] FROM [My Sheet Name] --Where Id='5815807987847044']]></Code>
        </Example>

        <Example Group="ODBC" Label="Get Sheet Rows by Id(s) (single or multiple)"        Desc="This example shows how to list multiple Sheet Rows by its Id(s). Supply Comma Separated List of Row IDs (Upto 100 recommended). You can also supply Row Number(s) instead of ID(s). If you supply both Id(s) and Row Number(s) then only common rows are selected.">
            <Code><![CDATA[SELECT * FROM get_sheet_rows_by_ids 
WITH (
  SheetId=3482072521854852
, Id='1312208360476548,6941707894689668,5815807987847044'
--OR-- (If you supply both Id and RowNumber then only Common Rows selected
--, RowNumber='1,2,100'
)]]></Code>
        </Example>		

        <Example Group="ODBC" Label="Get sheet rows by row number(s) (single or multiple)" Desc="This example shows how to list multiple Sheet Rows by its Row Number(s). Supply Comma Separated List of Row Numbers (Upto 100 recommended). You can also supply Row Id instead of Row Number(s). If you supply both Id(s) and Row Number(s) then only common rows are selected.">
            <Code><![CDATA[SELECT * FROM get_sheet_rows_by_ids 
WITH (
  SheetId=3482072521854852
, RowNumber='1,2,100'
--OR-- (If you supply both Id and RowNumber then only Common Rows selected
--, Id='1312208360476548,6941707894689668,5815807987847044'
)]]></Code>
        </Example>	

        <Example Default="True" Group="ODBC" Label="Create a new sheet row" Desc="This example shows how to create a new Sheet Row by calling INSERT statement. Optionally specify location where you like to insert new row (default is at bottom).">
            <Code><![CDATA[
INSERT INTO [My Sheet]
  ( [Some Text Number Column], [Some Checkbox Column], [Some Contact List Column], [Some Date Column], [Some PickList Column], [Some Multi PickList Column], [Some Symbol Column] )
VALUES 
  ('Updated at <<FUN_NOW>>', true, 'something@abc.com', '2024-12-31','Not Started','Value2,Value4','Green,Yellow')
/*
WITH(
RowLocation='"toTop": true'  --insert at the top
--OR--
--RowLocation='"siblingId": 1231234567'  --insert after some sibling row id
)			
*/

			]]></Code>
        </Example>		
        <Example Default="True" Group="ODBC" Label="Update a new sheet row" Desc="This example shows how to update specific columns of a Sheet Row by calling UPDATE statement.">
            <Code><![CDATA[
UPDATE [My Sheet]
SET [Some Text Number Column]='Updated - <<FUN_NOW>>',
    [Some Checkbox Column] = true,
    [Some Contact List Column] = 'something@abc.com',
    [Some Date Column] = '<<FUN_NOW>>',
    [Some PickList Column] = 'Not Started',
    [Some Multi PickList Column] = 'Value2,Value4',
    [Some Symbol Column] = 'Green,Yellow'
WHERE Id=7522710866202500		
WITH(Output=1)	
]]></Code>
        </Example>			

        <Example Default="True" Group="ODBC" Label="Delete sheet row(s) - single or multiple" Desc="This example shows how to delete single or multiple sheet rows by calling DELETE statement. You can supply a single Row Id or a comma-separated list of row Ids (Upto 100 recommended).">
            <Code><![CDATA[
DELETE FROM [My Sheet] WHERE Id=7522710866202500 
--WITH(IgnoreRowsNotFound='true' --or false)		
--Or
--DELETE FROM [My Sheet] WHERE Id='7522710866202500,7522710866202501,7522710866202502'
--WITH(IgnoreRowsNotFound='true' --or false)
]]></Code>
        </Example>	
		
        <Example Default="True" Group="ODBC" Label="Export Sheet (as PDF, Excel, CSV)" Desc="This example shows how to export Sheet to PDF, CSV or Excel file). If you export to PDF then you can also supply Paper size.">
            <Code><![CDATA[
SELECT * FROM export_sheet WITH(
  SheetId=1592926391979908, 
 ,TargetFilePath='c:\temp\exported_sheet_as_excel_file.xlsx' --or .pdf, .csv   
 ,Format='application/vnd.ms-excel'  --or-- application/pdf  --or-- text/csv
--below Paper Size only valid for PDF
--,PaperSize='LETTER' --or LEGAL, WIDE, ARCHD, A4, A3, A2, A1, A0
)
]]></Code>
        </Example>		

        <Example Default="True" Group="ODBC" Label="Export Report (as PDF, Excel, CSV)" Desc="This example shows how to export Report to PDF, CSV or Excel file). If you export to PDF then you can also supply Paper size.">
            <Code><![CDATA[
SELECT * FROM export_report WITH(
  ReportId=2972339541069700, 
 ,TargetFilePath='c:\temp\exported_report_as_excel_file.xlsx' --or .pdf, .csv   
 ,Format='application/vnd.ms-excel'  --or-- application/pdf  --or-- text/csv
--below Paper Size only valid for PDF
--,PaperSize='LETTER' --or LEGAL, WIDE, ARCHD, A4, A3, A2, A1, A0
)
]]></Code>
        </Example>	

        <Example Default="True" Group="ODBC" Label="Send Report via Email to Users or Groups (as PDF, Excel)" Desc="This example shows how to send Report via Email (PDF or Excel format) to list of emails or groups.">
            <Code><![CDATA[
SELECT * FROM send_report_email
WITH(
	  ReportId='2972339541069700'
	, Subject='Test report'
	, Message='This email contains report attachment'
	, CcMe='true'
	, PaperSize='LETTER'
	, SendToEmails='bob@mycompany.com~sam@mycompany.com'
	--OR (Emails or Group only - one allowed)
	--, SendToGroups='10022222001~10333330002'
)
]]></Code>
        </Example>	

        <Example Default="True" Group="ODBC" Label="Send Sheet via Email to Users or Groups (as PDF, Excel)" Desc="This example shows how to send Sheet via Email (PDF or Excel format) to list of emails or groups.">
            <Code><![CDATA[
SELECT * FROM send_sheet_email
WITH(
	  SheetId='1592926391979908'
	, Subject='Test report'
	, Message='This email contains report attachment'
	, CcMe='true'
	, PaperSize='LETTER'
	, SendToEmails='bob@mycompany.com~sam@mycompany.com'
	--OR (Emails or Group only - one allowed)
	--, SendToGroups='10022222001~10333330002'
)
]]></Code>
        </Example>			
    </Examples>
    
</ApiConfig>