Zendesk Connector
Documentation
Version: 9
Documentation

Table Organizations


Parameters

Parameter Label Required Options Description Help
There are no parameters

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

Zendesk
Organizations
SSIS API Source - Read from table or endpoint

Read/write to Organizations table using API Destination

Zendesk
Organizations
Select
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Get Organization(s)

SELECT * FROM Organizations --Where Id=1234

Create Organization

Create a new organization for specified email id and other information. If organization with same email exists then call fails.

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 Organization

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 Organization (Create or Update)

Creates an organization if the organization does not already exist, or updates an existing organization identified by e-mail address or external ID.

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 Organization

DELETE FROM Organizations Where id=21855694556443

Bulk Import Mode for Users or Organizations

This example shows how to upsert in bulk mode from external data and import into Zendesk. We used Microsoft SQL Server as source system in below example with static value query (just one row) but it can be any number of rows.

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:

Get Organization(s)

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Organizations --Where Id=1234';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];

Create Organization

Create a new organization for specified email id and other information. If organization with same email exists then call fails.

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 [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];

Update Organization

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 [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];

Upsert Organization (Create or Update)

Creates an organization if the organization does not already exist, or updates an existing organization identified by e-mail address or external ID.

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 [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];

Delete Organization

DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Organizations Where id=21855694556443';

EXEC (@MyQuery) AT [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];

Bulk Import Mode for Users or Organizations

This example shows how to upsert in bulk mode from external data and import into Zendesk. We used Microsoft SQL Server as source system in below example with static value query (just one row) but it can be any number of rows.

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 [LINKED_SERVER_TO_ZENDESK_IN_DATA_GATEWAY];