Table Organizations
Description
No description available
Supported Operations
Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.| Method | Supported | Reference EndPoint |
|---|---|---|
| SELECT | get_organizations | |
| INSERT | post_organization | |
| UPDATE | put_organization | |
| UPSERT | upsert_organization | |
| DELETE | delete_organization | |
| LOOKUP | get_organizations_by_ids |
Examples
SSIS
Use Zendesk Connector in API Source component to read data or in API Destination component to read/write data:
Read from Organizations table using API Source
| Optional Parameters | |
|---|---|
| NextUrlAttributeOrExpr | $.links.next |
| Records Per Page (Max 100) | 100 |
| NextUrlEndIndicator | false |
| StopIndicatorAttributeOrExpr | $.meta.has_more |
Read/write to Organizations table using API Destination
| Optional Parameters | |
|---|---|
| NextUrlAttributeOrExpr | $.links.next |
| Records Per Page (Max 100) | 100 |
| NextUrlEndIndicator | false |
| StopIndicatorAttributeOrExpr | $.meta.has_more |
ODBC application
Use these SQL queries in your ODBC application data source:
Read organizations
<p>Reads all organizations from the Zendesk account. This example demonstrates querying the <code>Organizations</code> table. You can optionally filter by ID using the <code>WHERE</code> clause.</p>
SELECT * FROM Organizations --Where Id=1234
Create an organization
<p>Creates a new organization in the <code>Organizations</code> table. This example demonstrates specifying organization details such as name, external ID, and custom fields.</p>
INSERT INTO Organizations
(
name
,external_id
,group_id
,tags
,details
,notes
,organization_fields
,domain_names
,shared_tickets
,shared_comments
)
VALUES(
'Abc Inc'
,'zcrm_1558554000052161270' --external_id
,114094762733
,'["paid","trial","solved"]'
,'some details'
,'some notes'
,'{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}'
,'["aaa.com", "bbb.com"]'
,'false'
,'false'
)
Update an organization
<p>Updates an existing organization by its ID. This example demonstrates modifying organization properties using the <code>UPDATE</code> statement.</p>
UPDATE Organizations
SET name='Abc Inc'
,external_id='zcrm_1558554000052161270'
,group_id=114094762733
,tags='["paid","trial","solved"]'
,details='some details'
,notes='some notes'
,organization_fields='{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}'
,domain_names='["aaa.com", "bbb.com"]'
,shared_tickets='false'
,shared_comments='false'
Where id=21863188631451
Upsert an organization
<p>Creates a new organization or updates an existing one. This example demonstrates using the <code>UPSERT INTO</code> statement, identifying the organization by ID or external ID.</p>
UPSERT INTO Organizations
(
name
--id or external_id can be supplied for UPSERT
,id
--or--
,external_id
,group_id
,tags
,details
,notes
,organization_fields
,domain_names
,shared_tickets
,shared_comments
)
VALUES(
'Abc Inc'
,1234567 --id
--or--
,'zcrm_1558554000052161270' --external_id
,114094762733
,'["paid","trial","solved"]'
,'some details'
,'some notes'
,'{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}'
,'["aaa.com", "bbb.com"]'
,'false'
,'false'
)
Delete an organization
<p>Deletes an organization by its ID. This example demonstrates using the <code>DELETE FROM</code> statement with a <code>WHERE</code> clause specifying the organization ID.</p>
DELETE FROM Organizations Where id=21855694556443
Bulk upsert users/organizations using SQL Server data
<p>Upserts users or organizations in bulk using data from a SQL Server database. This example demonstrates using the <code>UPSERT INTO ... SOURCE</code> syntax to read data from an external source and import it into Zendesk.</p>
UPSERT INTO Organizations
SOURCE('MSSQL' --ODBC
, 'Data Source=localhost;Initial Catalog=test;Integrated Security=true'
--For bulk input, map columns in External Query (Must use alias column name to match INSERT command Input Column names - see help file)
--If parameter value not same for all input rows then you can prefix some column with $$ to map as parameter (i.e. $$MyParam1)
--'ODBC', 'Driver={ZappySys CSV Driver};DataPath=C:\AccountsToInsert.csv'
--'ODBC', 'DSN=MyDSN'
--'OLEDB', 'Provider=SQLNCLI11;Server=localhost,1433;Database=tempdb;Trusted_Connection=yes;'
, 'select
21863188631451 as id
, ''Abc Inc'' as name
,''zcrm_1558554000052161270'' as external_id
,114094762733 as group_id
,''["paid","trial","solved"]'' as tags
,''some details'' as details
,''some notes'' as notes
,''{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}'' as organization_fields
,''["aaa.com", "bbb.com"]'' domain_names
,''false'' as shared_tickets
,''false'' as shared_comments
')
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read organizations
<p>Reads all organizations from the Zendesk account. This example demonstrates querying the <code>Organizations</code> table. You can optionally filter by ID using the <code>WHERE</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Organizations --Where Id=1234';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Create an organization
<p>Creates a new organization in the <code>Organizations</code> table. This example demonstrates specifying organization details such as name, external ID, and custom fields.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Organizations
(
name
,external_id
,group_id
,tags
,details
,notes
,organization_fields
,domain_names
,shared_tickets
,shared_comments
)
VALUES(
''Abc Inc''
,''zcrm_1558554000052161270'' --external_id
,114094762733
,''["paid","trial","solved"]''
,''some details''
,''some notes''
,''{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}''
,''["aaa.com", "bbb.com"]''
,''false''
,''false''
)';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Update an organization
<p>Updates an existing organization by its ID. This example demonstrates modifying organization properties using the <code>UPDATE</code> statement.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Organizations
SET name=''Abc Inc''
,external_id=''zcrm_1558554000052161270''
,group_id=114094762733
,tags=''["paid","trial","solved"]''
,details=''some details''
,notes=''some notes''
,organization_fields=''{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}''
,domain_names=''["aaa.com", "bbb.com"]''
,shared_tickets=''false''
,shared_comments=''false''
Where id=21863188631451';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Upsert an organization
<p>Creates a new organization or updates an existing one. This example demonstrates using the <code>UPSERT INTO</code> statement, identifying the organization by ID or external ID.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPSERT INTO Organizations
(
name
--id or external_id can be supplied for UPSERT
,id
--or--
,external_id
,group_id
,tags
,details
,notes
,organization_fields
,domain_names
,shared_tickets
,shared_comments
)
VALUES(
''Abc Inc''
,1234567 --id
--or--
,''zcrm_1558554000052161270'' --external_id
,114094762733
,''["paid","trial","solved"]''
,''some details''
,''some notes''
,''{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}''
,''["aaa.com", "bbb.com"]''
,''false''
,''false''
)';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Delete an organization
<p>Deletes an organization by its ID. This example demonstrates using the <code>DELETE FROM</code> statement with a <code>WHERE</code> clause specifying the organization ID.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Organizations Where id=21855694556443';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];
Bulk upsert users/organizations using SQL Server data
<p>Upserts users or organizations in bulk using data from a SQL Server database. This example demonstrates using the <code>UPSERT INTO ... SOURCE</code> syntax to read data from an external source and import it into Zendesk.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPSERT INTO Organizations
SOURCE(''MSSQL'' --ODBC
, ''Data Source=localhost;Initial Catalog=test;Integrated Security=true''
--For bulk input, map columns in External Query (Must use alias column name to match INSERT command Input Column names - see help file)
--If parameter value not same for all input rows then you can prefix some column with $$ to map as parameter (i.e. $$MyParam1)
--''ODBC'', ''Driver={ZappySys CSV Driver};DataPath=C:\AccountsToInsert.csv''
--''ODBC'', ''DSN=MyDSN''
--''OLEDB'', ''Provider=SQLNCLI11;Server=localhost,1433;Database=tempdb;Trusted_Connection=yes;''
, ''select
21863188631451 as id
, ''''Abc Inc'''' as name
,''''zcrm_1558554000052161270'''' as external_id
,114094762733 as group_id
,''''["paid","trial","solved"]'''' as tags
,''''some details'''' as details
,''''some notes'''' as notes
,''''{"startdate": "1981-01-23", "revenue": 12000000.50, "somenumber": 1235678}'''' as organization_fields
,''''["aaa.com", "bbb.com"]'''' domain_names
,''''false'''' as shared_tickets
,''''false'''' as shared_comments
'')';
EXEC (@MyQuery) AT [LS_TO_ZENDESK_IN_GATEWAY];