SQL Server / Zoho CRM REST APIs / Contact Roles of a Specific Deal
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://domain.com/crm/v2/Deals/738964000002224056/Contact_Roles', @sbResponseBody
IF @success = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
-- Sample JSON response:
-- (Sample code for parsing the JSON response is shown below)
-- {
-- "data": [
-- {
-- "Owner": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia.b@zylker.com"
-- },
-- "Email": null,
-- "$currency_symbol": "Af",
-- "Other_Phone": null,
-- "Mailing_State": null,
-- "Other_State": null,
-- "Other_Country": null,
-- "Last_Activity_Time": "2021-03-02T08:06:35+00:00",
-- "Department": null,
-- "Contact_Role": "738964000000007170",
-- "$state": "save",
-- "Unsubscribed_Mode": null,
-- "$process_flow": false,
-- "Assistant": null,
-- "Exchange_Rate": 1,
-- "Currency": "AFN",
-- "Mailing_Country": null,
-- "Data_Processing_Basis_Details": null,
-- "id": "738964000001112068",
-- "Data_Source": "Manual",
-- "$approved": true,
-- "Reporting_To": null,
-- "$approval": {
-- "delegate": false,
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Other_City": null,
-- "$data_source_details": null,
-- "Created_Time": "2020-07-09T06:36:27+00:00",
-- "$editable": true,
-- "Home_Phone": null,
-- "Created_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Secondary_Email": null,
-- "Description": null,
-- "Vendor_Name": null,
-- "Mailing_Zip": null,
-- "$review_process": {
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Twitter": null,
-- "Other_Zip": null,
-- "Mailing_Street": null,
-- "Salutation": null,
-- "First_Name": null,
-- "Full_Name": "Boyle",
-- "Asst_Phone": null,
-- "Record_Image": null,
-- "Modified_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "$review": null,
-- "Skype_ID": null,
-- "Phone": null,
-- "Account_Name": {
-- "name": "zylker",
-- "id": "738964000001112135"
-- },
-- "Email_Opt_Out": false,
-- "Modified_Time": "2020-10-22T14:46:41+00:00",
-- "Date_of_Birth": null,
-- "Mailing_City": null,
-- "Unsubscribed_Time": null,
-- "Title": null,
-- "Other_Street": null,
-- "Mobile": null,
-- "$orchestration": false,
-- "$stop_processing": false,
-- "Last_Name": "Boyle",
-- "$in_merge": false,
-- "Lead_Source": null,
-- "Tag": [
-- ],
-- "Fax": null,
-- "$approval_state": "approved"
-- },
-- {
-- "Owner": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Email": null,
-- "$currency_symbol": "Af",
-- "Other_Phone": null,
-- "Mailing_State": null,
-- "Other_State": null,
-- "Other_Country": null,
-- "Last_Activity_Time": null,
-- "Department": null,
-- "Contact_Role": "738964000000007170",
-- "$state": "save",
-- "Unsubscribed_Mode": null,
-- "$process_flow": false,
-- "Assistant": null,
-- "Exchange_Rate": 1,
-- "Currency": "AFN",
-- "Mailing_Country": null,
-- "Data_Processing_Basis_Details": null,
-- "id": "738964000001682005",
-- "Data_Source": "Manual",
-- "$approved": true,
-- "Reporting_To": {
-- "name": "Boyle",
-- "id": "738964000001112068"
-- },
-- "$approval": {
-- "delegate": false,
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Other_City": null,
-- "$data_source_details": null,
-- "Created_Time": "2020-12-15T07:09:59+00:00",
-- "$editable": true,
-- "Home_Phone": null,
-- "Created_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Secondary_Email": null,
-- "Description": null,
-- "Vendor_Name": null,
-- "Mailing_Zip": null,
-- "$review_process": {
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Twitter": null,
-- "Other_Zip": null,
-- "Mailing_Street": null,
-- "Salutation": "Ms.",
-- "First_Name": "Patricia",
-- "Full_Name": "Ms. Patricia Boyle",
-- "Asst_Phone": null,
-- "Record_Image": null,
-- "Modified_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "$review": null,
-- "Skype_ID": null,
-- "Phone": null,
-- "Account_Name": {
-- "name": "zylker",
-- "id": "738964000001112135"
-- },
-- "Email_Opt_Out": false,
-- "Modified_Time": "2020-12-15T07:09:59+00:00",
-- "Date_of_Birth": null,
-- "Mailing_City": null,
-- "Unsubscribed_Time": null,
-- "Title": null,
-- "Other_Street": null,
-- "Mobile": null,
-- "$orchestration": false,
-- "$stop_processing": false,
-- "Last_Name": "Boyle",
-- "$in_merge": false,
-- "Lead_Source": null,
-- "Tag": [
-- ],
-- "Fax": null,
-- "$approval_state": "approved"
-- },
-- {
-- "Owner": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Email": null,
-- "$currency_symbol": "Af",
-- "Other_Phone": null,
-- "Mailing_State": null,
-- "Other_State": null,
-- "Other_Country": null,
-- "Last_Activity_Time": null,
-- "Department": null,
-- "Contact_Role": "738964000000007170",
-- "$state": "save",
-- "Unsubscribed_Mode": null,
-- "$process_flow": false,
-- "Assistant": null,
-- "Exchange_Rate": 1,
-- "Currency": "AFN",
-- "Mailing_Country": null,
-- "Data_Processing_Basis_Details": null,
-- "id": "738964000001919009",
-- "Data_Source": "API",
-- "$approved": true,
-- "Reporting_To": null,
-- "$approval": {
-- "delegate": false,
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Other_City": null,
-- "$data_source_details": {},
-- "Created_Time": "2021-03-02T09:18:59+00:00",
-- "$editable": true,
-- "Home_Phone": null,
-- "Created_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Secondary_Email": null,
-- "Description": null,
-- "Vendor_Name": null,
-- "Mailing_Zip": null,
-- "$review_process": {
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Twitter": null,
-- "Other_Zip": null,
-- "Mailing_Street": null,
-- "Salutation": null,
-- "First_Name": null,
-- "Full_Name": "Patricia",
-- "Asst_Phone": null,
-- "Record_Image": null,
-- "Modified_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "$review": null,
-- "Skype_ID": null,
-- "Phone": null,
-- "Account_Name": null,
-- "Email_Opt_Out": false,
-- "Modified_Time": "2021-03-02T09:18:59+00:00",
-- "Date_of_Birth": null,
-- "Mailing_City": null,
-- "Unsubscribed_Time": null,
-- "Title": null,
-- "Other_Street": null,
-- "Mobile": null,
-- "$orchestration": false,
-- "$stop_processing": false,
-- "Last_Name": "Patricia",
-- "$in_merge": false,
-- "Lead_Source": null,
-- "Tag": [
-- ],
-- "Fax": null,
-- "$approval_state": "approved"
-- },
-- {
-- "Owner": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Email": "contact_test@xyz.com",
-- "$currency_symbol": "Af",
-- "Other_Phone": null,
-- "Mailing_State": "Colorado",
-- "Other_State": null,
-- "Other_Country": null,
-- "Last_Activity_Time": "2021-06-02T15:46:37+00:00",
-- "Department": null,
-- "Contact_Role": null,
-- "$state": "save",
-- "Unsubscribed_Mode": null,
-- "$process_flow": false,
-- "Assistant": null,
-- "Exchange_Rate": 1,
-- "Currency": "AFN",
-- "Mailing_Country": null,
-- "Data_Processing_Basis_Details": null,
-- "id": "738964000002224050",
-- "Data_Source": "Converted",
-- "$approved": true,
-- "Reporting_To": null,
-- "$approval": {
-- "delegate": false,
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Other_City": null,
-- "$data_source_details": null,
-- "Created_Time": "2021-06-02T15:46:36+00:00",
-- "$editable": true,
-- "Home_Phone": null,
-- "Created_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "Secondary_Email": null,
-- "Description": null,
-- "Vendor_Name": null,
-- "Mailing_Zip": "1234",
-- "$review_process": {
-- "approve": false,
-- "reject": false,
-- "resubmit": false
-- },
-- "Twitter": null,
-- "Other_Zip": null,
-- "Mailing_Street": null,
-- "Salutation": null,
-- "First_Name": null,
-- "Full_Name": "Contact_test",
-- "Asst_Phone": null,
-- "Record_Image": null,
-- "Modified_By": {
-- "name": "Patricia Boyle",
-- "id": "738964000000291009",
-- "email": "patricia@zylker.com"
-- },
-- "$review": null,
-- "Skype_ID": null,
-- "Phone": null,
-- "Account_Name": null,
-- "Email_Opt_Out": false,
-- "Modified_Time": "2021-06-02T15:46:36+00:00",
-- "Date_of_Birth": null,
-- "Mailing_City": null,
-- "Unsubscribed_Time": null,
-- "Title": null,
-- "Other_Street": null,
-- "Mobile": null,
-- "$orchestration": false,
-- "$stop_processing": false,
-- "Last_Name": "Contact_test",
-- "$in_merge": false,
-- "Lead_Source": null,
-- "Tag": [
-- ],
-- "Fax": null,
-- "$approval_state": "approved"
-- }
-- ],
-- "info": {
-- "per_page": 200,
-- "count": 4,
-- "page": 1,
-- "more_records": false
-- }
-- }
-- Sample code for parsing the JSON response...
-- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
DECLARE @Name nvarchar(4000)
DECLARE @Id nvarchar(4000)
DECLARE @v_Email nvarchar(4000)
DECLARE @Scurrency_symbol nvarchar(4000)
DECLARE @Other_Phone nvarchar(4000)
DECLARE @Mailing_State nvarchar(4000)
DECLARE @Other_State nvarchar(4000)
DECLARE @Other_Country nvarchar(4000)
DECLARE @Last_Activity_Time nvarchar(4000)
DECLARE @Department nvarchar(4000)
DECLARE @Contact_Role nvarchar(4000)
DECLARE @Sstate nvarchar(4000)
DECLARE @Unsubscribed_Mode nvarchar(4000)
DECLARE @Sprocess_flow int
DECLARE @Assistant nvarchar(4000)
DECLARE @Exchange_Rate int
DECLARE @v_Currency nvarchar(4000)
DECLARE @Mailing_Country nvarchar(4000)
DECLARE @Data_Processing_Basis_Details nvarchar(4000)
DECLARE @id nvarchar(4000)
DECLARE @Data_Source nvarchar(4000)
DECLARE @Sapproved int
DECLARE @Reporting_To nvarchar(4000)
DECLARE @Delegate int
DECLARE @Approve int
DECLARE @Reject int
DECLARE @Resubmit int
DECLARE @Other_City nvarchar(4000)
DECLARE @Sdata_source_details nvarchar(4000)
DECLARE @Created_Time nvarchar(4000)
DECLARE @Seditable int
DECLARE @Home_Phone nvarchar(4000)
DECLARE @Created_ByName nvarchar(4000)
DECLARE @Created_ById nvarchar(4000)
DECLARE @Created_ByEmail nvarchar(4000)
DECLARE @Secondary_Email nvarchar(4000)
DECLARE @Description nvarchar(4000)
DECLARE @Vendor_Name nvarchar(4000)
DECLARE @Mailing_Zip nvarchar(4000)
DECLARE @Sreview_processApprove int
DECLARE @Sreview_processReject int
DECLARE @Sreview_processResubmit int
DECLARE @Twitter nvarchar(4000)
DECLARE @Other_Zip nvarchar(4000)
DECLARE @Mailing_Street nvarchar(4000)
DECLARE @Salutation nvarchar(4000)
DECLARE @First_Name nvarchar(4000)
DECLARE @Full_Name nvarchar(4000)
DECLARE @Asst_Phone nvarchar(4000)
DECLARE @Record_Image nvarchar(4000)
DECLARE @Modified_ByName nvarchar(4000)
DECLARE @Modified_ById nvarchar(4000)
DECLARE @Modified_ByEmail nvarchar(4000)
DECLARE @Sreview nvarchar(4000)
DECLARE @Skype_ID nvarchar(4000)
DECLARE @Phone nvarchar(4000)
DECLARE @Account_NameName nvarchar(4000)
DECLARE @Account_NameId nvarchar(4000)
DECLARE @Email_Opt_Out int
DECLARE @Modified_Time nvarchar(4000)
DECLARE @Date_of_Birth nvarchar(4000)
DECLARE @Mailing_City nvarchar(4000)
DECLARE @Unsubscribed_Time nvarchar(4000)
DECLARE @Title nvarchar(4000)
DECLARE @Other_Street nvarchar(4000)
DECLARE @Mobile nvarchar(4000)
DECLARE @Sorchestration int
DECLARE @Sstop_processing int
DECLARE @Last_Name nvarchar(4000)
DECLARE @Sin_merge int
DECLARE @Lead_Source nvarchar(4000)
DECLARE @Fax nvarchar(4000)
DECLARE @Sapproval_state nvarchar(4000)
DECLARE @Reporting_ToName nvarchar(4000)
DECLARE @Reporting_ToId nvarchar(4000)
DECLARE @Account_Name nvarchar(4000)
DECLARE @j int
DECLARE @count_j int
DECLARE @Per_page int
EXEC sp_OAMethod @jResp, 'IntOf', @Per_page OUT, 'info.per_page'
DECLARE @Count int
EXEC sp_OAMethod @jResp, 'IntOf', @Count OUT, 'info.count'
DECLARE @Page int
EXEC sp_OAMethod @jResp, 'IntOf', @Page OUT, 'info.page'
DECLARE @More_records int
EXEC sp_OAMethod @jResp, 'BoolOf', @More_records OUT, 'info.more_records'
DECLARE @i int
SELECT @i = 0
DECLARE @count_i int
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Name OUT, 'data[i].Owner.name'
EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'data[i].Owner.id'
EXEC sp_OAMethod @jResp, 'StringOf', @v_Email OUT, 'data[i].Owner.email'
EXEC sp_OAMethod @jResp, 'StringOf', @v_Email OUT, 'data[i].Email'
EXEC sp_OAMethod @jResp, 'StringOf', @Scurrency_symbol OUT, 'data[i].$currency_symbol'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_Phone OUT, 'data[i].Other_Phone'
EXEC sp_OAMethod @jResp, 'StringOf', @Mailing_State OUT, 'data[i].Mailing_State'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_State OUT, 'data[i].Other_State'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_Country OUT, 'data[i].Other_Country'
EXEC sp_OAMethod @jResp, 'StringOf', @Last_Activity_Time OUT, 'data[i].Last_Activity_Time'
EXEC sp_OAMethod @jResp, 'StringOf', @Department OUT, 'data[i].Department'
EXEC sp_OAMethod @jResp, 'StringOf', @Contact_Role OUT, 'data[i].Contact_Role'
EXEC sp_OAMethod @jResp, 'StringOf', @Sstate OUT, 'data[i].$state'
EXEC sp_OAMethod @jResp, 'StringOf', @Unsubscribed_Mode OUT, 'data[i].Unsubscribed_Mode'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sprocess_flow OUT, 'data[i].$process_flow'
EXEC sp_OAMethod @jResp, 'StringOf', @Assistant OUT, 'data[i].Assistant'
EXEC sp_OAMethod @jResp, 'IntOf', @Exchange_Rate OUT, 'data[i].Exchange_Rate'
EXEC sp_OAMethod @jResp, 'StringOf', @v_Currency OUT, 'data[i].Currency'
EXEC sp_OAMethod @jResp, 'StringOf', @Mailing_Country OUT, 'data[i].Mailing_Country'
EXEC sp_OAMethod @jResp, 'StringOf', @Data_Processing_Basis_Details OUT, 'data[i].Data_Processing_Basis_Details'
EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'data[i].id'
EXEC sp_OAMethod @jResp, 'StringOf', @Data_Source OUT, 'data[i].Data_Source'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sapproved OUT, 'data[i].$approved'
EXEC sp_OAMethod @jResp, 'StringOf', @Reporting_To OUT, 'data[i].Reporting_To'
EXEC sp_OAMethod @jResp, 'BoolOf', @Delegate OUT, 'data[i].$approval.delegate'
EXEC sp_OAMethod @jResp, 'BoolOf', @Approve OUT, 'data[i].$approval.approve'
EXEC sp_OAMethod @jResp, 'BoolOf', @Reject OUT, 'data[i].$approval.reject'
EXEC sp_OAMethod @jResp, 'BoolOf', @Resubmit OUT, 'data[i].$approval.resubmit'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_City OUT, 'data[i].Other_City'
EXEC sp_OAMethod @jResp, 'StringOf', @Sdata_source_details OUT, 'data[i].$data_source_details'
EXEC sp_OAMethod @jResp, 'StringOf', @Created_Time OUT, 'data[i].Created_Time'
EXEC sp_OAMethod @jResp, 'BoolOf', @Seditable OUT, 'data[i].$editable'
EXEC sp_OAMethod @jResp, 'StringOf', @Home_Phone OUT, 'data[i].Home_Phone'
EXEC sp_OAMethod @jResp, 'StringOf', @Created_ByName OUT, 'data[i].Created_By.name'
EXEC sp_OAMethod @jResp, 'StringOf', @Created_ById OUT, 'data[i].Created_By.id'
EXEC sp_OAMethod @jResp, 'StringOf', @Created_ByEmail OUT, 'data[i].Created_By.email'
EXEC sp_OAMethod @jResp, 'StringOf', @Secondary_Email OUT, 'data[i].Secondary_Email'
EXEC sp_OAMethod @jResp, 'StringOf', @Description OUT, 'data[i].Description'
EXEC sp_OAMethod @jResp, 'StringOf', @Vendor_Name OUT, 'data[i].Vendor_Name'
EXEC sp_OAMethod @jResp, 'StringOf', @Mailing_Zip OUT, 'data[i].Mailing_Zip'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processApprove OUT, 'data[i].$review_process.approve'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processReject OUT, 'data[i].$review_process.reject'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sreview_processResubmit OUT, 'data[i].$review_process.resubmit'
EXEC sp_OAMethod @jResp, 'StringOf', @Twitter OUT, 'data[i].Twitter'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_Zip OUT, 'data[i].Other_Zip'
EXEC sp_OAMethod @jResp, 'StringOf', @Mailing_Street OUT, 'data[i].Mailing_Street'
EXEC sp_OAMethod @jResp, 'StringOf', @Salutation OUT, 'data[i].Salutation'
EXEC sp_OAMethod @jResp, 'StringOf', @First_Name OUT, 'data[i].First_Name'
EXEC sp_OAMethod @jResp, 'StringOf', @Full_Name OUT, 'data[i].Full_Name'
EXEC sp_OAMethod @jResp, 'StringOf', @Asst_Phone OUT, 'data[i].Asst_Phone'
EXEC sp_OAMethod @jResp, 'StringOf', @Record_Image OUT, 'data[i].Record_Image'
EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ByName OUT, 'data[i].Modified_By.name'
EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ById OUT, 'data[i].Modified_By.id'
EXEC sp_OAMethod @jResp, 'StringOf', @Modified_ByEmail OUT, 'data[i].Modified_By.email'
EXEC sp_OAMethod @jResp, 'StringOf', @Sreview OUT, 'data[i].$review'
EXEC sp_OAMethod @jResp, 'StringOf', @Skype_ID OUT, 'data[i].Skype_ID'
EXEC sp_OAMethod @jResp, 'StringOf', @Phone OUT, 'data[i].Phone'
EXEC sp_OAMethod @jResp, 'StringOf', @Account_NameName OUT, 'data[i].Account_Name.name'
EXEC sp_OAMethod @jResp, 'StringOf', @Account_NameId OUT, 'data[i].Account_Name.id'
EXEC sp_OAMethod @jResp, 'BoolOf', @Email_Opt_Out OUT, 'data[i].Email_Opt_Out'
EXEC sp_OAMethod @jResp, 'StringOf', @Modified_Time OUT, 'data[i].Modified_Time'
EXEC sp_OAMethod @jResp, 'StringOf', @Date_of_Birth OUT, 'data[i].Date_of_Birth'
EXEC sp_OAMethod @jResp, 'StringOf', @Mailing_City OUT, 'data[i].Mailing_City'
EXEC sp_OAMethod @jResp, 'StringOf', @Unsubscribed_Time OUT, 'data[i].Unsubscribed_Time'
EXEC sp_OAMethod @jResp, 'StringOf', @Title OUT, 'data[i].Title'
EXEC sp_OAMethod @jResp, 'StringOf', @Other_Street OUT, 'data[i].Other_Street'
EXEC sp_OAMethod @jResp, 'StringOf', @Mobile OUT, 'data[i].Mobile'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sorchestration OUT, 'data[i].$orchestration'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sstop_processing OUT, 'data[i].$stop_processing'
EXEC sp_OAMethod @jResp, 'StringOf', @Last_Name OUT, 'data[i].Last_Name'
EXEC sp_OAMethod @jResp, 'BoolOf', @Sin_merge OUT, 'data[i].$in_merge'
EXEC sp_OAMethod @jResp, 'StringOf', @Lead_Source OUT, 'data[i].Lead_Source'
EXEC sp_OAMethod @jResp, 'StringOf', @Fax OUT, 'data[i].Fax'
EXEC sp_OAMethod @jResp, 'StringOf', @Sapproval_state OUT, 'data[i].$approval_state'
EXEC sp_OAMethod @jResp, 'StringOf', @Reporting_ToName OUT, 'data[i].Reporting_To.name'
EXEC sp_OAMethod @jResp, 'StringOf', @Reporting_ToId OUT, 'data[i].Reporting_To.id'
EXEC sp_OAMethod @jResp, 'StringOf', @Account_Name OUT, 'data[i].Account_Name'
SELECT @j = 0
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'data[i].Tag'
WHILE @j < @count_j
BEGIN
EXEC sp_OASetProperty @jResp, 'J', @j
SELECT @j = @j + 1
END
SELECT @i = @i + 1
END
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
https://domain.com/crm/v2/Deals/738964000002224056/Contact_Roles
Postman Collection Item JSON
{
"name": "Contact Roles of a Specific Deal",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access-token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deals/738964000002224056/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deals",
"738964000002224056",
"Contact_Roles"
]
}
},
"response": [
{
"name": "SUCCESS RESPONSE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deals/738964000002224056/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deals",
"738964000002224056",
"Contact_Roles"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Fri, 18 Jun 2021 13:12:08 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-store, no-cache, must-revalidate, private"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-06-18T13:56:39+00:00"
},
{
"key": "clientVersion",
"value": "4126581"
},
{
"key": "clientsubVersion",
"value": "4db5c971143ce609008746cb1d40f588"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "vary",
"value": "accept-encoding"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Content-Language",
"value": "en-US"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=63072000"
}
],
"cookie": [
],
"body": "{\n \"data\": [\n {\n \"Owner\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia.b@zylker.com\"\n },\n \"Email\": null,\n \"$currency_symbol\": \"Af\",\n \"Other_Phone\": null,\n \"Mailing_State\": null,\n \"Other_State\": null,\n \"Other_Country\": null,\n \"Last_Activity_Time\": \"2021-03-02T08:06:35+00:00\",\n \"Department\": null,\n \"Contact_Role\": \"738964000000007170\",\n \"$state\": \"save\",\n \"Unsubscribed_Mode\": null,\n \"$process_flow\": false,\n \"Assistant\": null,\n \"Exchange_Rate\": 1,\n \"Currency\": \"AFN\",\n \"Mailing_Country\": null,\n \"Data_Processing_Basis_Details\": null,\n \"id\": \"738964000001112068\",\n \"Data_Source\": \"Manual\",\n \"$approved\": true,\n \"Reporting_To\": null,\n \"$approval\": {\n \"delegate\": false,\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Other_City\": null,\n \"$data_source_details\": null,\n \"Created_Time\": \"2020-07-09T06:36:27+00:00\",\n \"$editable\": true,\n \"Home_Phone\": null,\n \"Created_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Secondary_Email\": null,\n \"Description\": null,\n \"Vendor_Name\": null,\n \"Mailing_Zip\": null,\n \"$review_process\": {\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Twitter\": null,\n \"Other_Zip\": null,\n \"Mailing_Street\": null,\n \"Salutation\": null,\n \"First_Name\": null,\n \"Full_Name\": \"Boyle\",\n \"Asst_Phone\": null,\n \"Record_Image\": null,\n \"Modified_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"$review\": null,\n \"Skype_ID\": null,\n \"Phone\": null,\n \"Account_Name\": {\n \"name\": \"zylker\",\n \"id\": \"738964000001112135\"\n },\n \"Email_Opt_Out\": false,\n \"Modified_Time\": \"2020-10-22T14:46:41+00:00\",\n \"Date_of_Birth\": null,\n \"Mailing_City\": null,\n \"Unsubscribed_Time\": null,\n \"Title\": null,\n \"Other_Street\": null,\n \"Mobile\": null,\n \"$orchestration\": false,\n \"$stop_processing\": false,\n \"Last_Name\": \"Boyle\",\n \"$in_merge\": false,\n \"Lead_Source\": null,\n \"Tag\": [],\n \"Fax\": null,\n \"$approval_state\": \"approved\"\n },\n {\n \"Owner\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Email\": null,\n \"$currency_symbol\": \"Af\",\n \"Other_Phone\": null,\n \"Mailing_State\": null,\n \"Other_State\": null,\n \"Other_Country\": null,\n \"Last_Activity_Time\": null,\n \"Department\": null,\n \"Contact_Role\": \"738964000000007170\",\n \"$state\": \"save\",\n \"Unsubscribed_Mode\": null,\n \"$process_flow\": false,\n \"Assistant\": null,\n \"Exchange_Rate\": 1,\n \"Currency\": \"AFN\",\n \"Mailing_Country\": null,\n \"Data_Processing_Basis_Details\": null,\n \"id\": \"738964000001682005\",\n \"Data_Source\": \"Manual\",\n \"$approved\": true,\n \"Reporting_To\": {\n \"name\": \"Boyle\",\n \"id\": \"738964000001112068\"\n },\n \"$approval\": {\n \"delegate\": false,\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Other_City\": null,\n \"$data_source_details\": null,\n \"Created_Time\": \"2020-12-15T07:09:59+00:00\",\n \"$editable\": true,\n \"Home_Phone\": null,\n \"Created_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Secondary_Email\": null,\n \"Description\": null,\n \"Vendor_Name\": null,\n \"Mailing_Zip\": null,\n \"$review_process\": {\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Twitter\": null,\n \"Other_Zip\": null,\n \"Mailing_Street\": null,\n \"Salutation\": \"Ms.\",\n \"First_Name\": \"Patricia\",\n \"Full_Name\": \"Ms. Patricia Boyle\",\n \"Asst_Phone\": null,\n \"Record_Image\": null,\n \"Modified_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"$review\": null,\n \"Skype_ID\": null,\n \"Phone\": null,\n \"Account_Name\": {\n \"name\": \"zylker\",\n \"id\": \"738964000001112135\"\n },\n \"Email_Opt_Out\": false,\n \"Modified_Time\": \"2020-12-15T07:09:59+00:00\",\n \"Date_of_Birth\": null,\n \"Mailing_City\": null,\n \"Unsubscribed_Time\": null,\n \"Title\": null,\n \"Other_Street\": null,\n \"Mobile\": null,\n \"$orchestration\": false,\n \"$stop_processing\": false,\n \"Last_Name\": \"Boyle\",\n \"$in_merge\": false,\n \"Lead_Source\": null,\n \"Tag\": [],\n \"Fax\": null,\n \"$approval_state\": \"approved\"\n },\n {\n \"Owner\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Email\": null,\n \"$currency_symbol\": \"Af\",\n \"Other_Phone\": null,\n \"Mailing_State\": null,\n \"Other_State\": null,\n \"Other_Country\": null,\n \"Last_Activity_Time\": null,\n \"Department\": null,\n \"Contact_Role\": \"738964000000007170\",\n \"$state\": \"save\",\n \"Unsubscribed_Mode\": null,\n \"$process_flow\": false,\n \"Assistant\": null,\n \"Exchange_Rate\": 1,\n \"Currency\": \"AFN\",\n \"Mailing_Country\": null,\n \"Data_Processing_Basis_Details\": null,\n \"id\": \"738964000001919009\",\n \"Data_Source\": \"API\",\n \"$approved\": true,\n \"Reporting_To\": null,\n \"$approval\": {\n \"delegate\": false,\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Other_City\": null,\n \"$data_source_details\": {},\n \"Created_Time\": \"2021-03-02T09:18:59+00:00\",\n \"$editable\": true,\n \"Home_Phone\": null,\n \"Created_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Secondary_Email\": null,\n \"Description\": null,\n \"Vendor_Name\": null,\n \"Mailing_Zip\": null,\n \"$review_process\": {\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Twitter\": null,\n \"Other_Zip\": null,\n \"Mailing_Street\": null,\n \"Salutation\": null,\n \"First_Name\": null,\n \"Full_Name\": \"Patricia\",\n \"Asst_Phone\": null,\n \"Record_Image\": null,\n \"Modified_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"$review\": null,\n \"Skype_ID\": null,\n \"Phone\": null,\n \"Account_Name\": null,\n \"Email_Opt_Out\": false,\n \"Modified_Time\": \"2021-03-02T09:18:59+00:00\",\n \"Date_of_Birth\": null,\n \"Mailing_City\": null,\n \"Unsubscribed_Time\": null,\n \"Title\": null,\n \"Other_Street\": null,\n \"Mobile\": null,\n \"$orchestration\": false,\n \"$stop_processing\": false,\n \"Last_Name\": \"Patricia\",\n \"$in_merge\": false,\n \"Lead_Source\": null,\n \"Tag\": [],\n \"Fax\": null,\n \"$approval_state\": \"approved\"\n },\n {\n \"Owner\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Email\": \"contact_test@xyz.com\",\n \"$currency_symbol\": \"Af\",\n \"Other_Phone\": null,\n \"Mailing_State\": \"Colorado\",\n \"Other_State\": null,\n \"Other_Country\": null,\n \"Last_Activity_Time\": \"2021-06-02T15:46:37+00:00\",\n \"Department\": null,\n \"Contact_Role\": null,\n \"$state\": \"save\",\n \"Unsubscribed_Mode\": null,\n \"$process_flow\": false,\n \"Assistant\": null,\n \"Exchange_Rate\": 1,\n \"Currency\": \"AFN\",\n \"Mailing_Country\": null,\n \"Data_Processing_Basis_Details\": null,\n \"id\": \"738964000002224050\",\n \"Data_Source\": \"Converted\",\n \"$approved\": true,\n \"Reporting_To\": null,\n \"$approval\": {\n \"delegate\": false,\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Other_City\": null,\n \"$data_source_details\": null,\n \"Created_Time\": \"2021-06-02T15:46:36+00:00\",\n \"$editable\": true,\n \"Home_Phone\": null,\n \"Created_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"Secondary_Email\": null,\n \"Description\": null,\n \"Vendor_Name\": null,\n \"Mailing_Zip\": \"1234\",\n \"$review_process\": {\n \"approve\": false,\n \"reject\": false,\n \"resubmit\": false\n },\n \"Twitter\": null,\n \"Other_Zip\": null,\n \"Mailing_Street\": null,\n \"Salutation\": null,\n \"First_Name\": null,\n \"Full_Name\": \"Contact_test\",\n \"Asst_Phone\": null,\n \"Record_Image\": null,\n \"Modified_By\": {\n \"name\": \"Patricia Boyle\",\n \"id\": \"738964000000291009\",\n \"email\": \"patricia@zylker.com\"\n },\n \"$review\": null,\n \"Skype_ID\": null,\n \"Phone\": null,\n \"Account_Name\": null,\n \"Email_Opt_Out\": false,\n \"Modified_Time\": \"2021-06-02T15:46:36+00:00\",\n \"Date_of_Birth\": null,\n \"Mailing_City\": null,\n \"Unsubscribed_Time\": null,\n \"Title\": null,\n \"Other_Street\": null,\n \"Mobile\": null,\n \"$orchestration\": false,\n \"$stop_processing\": false,\n \"Last_Name\": \"Contact_test\",\n \"$in_merge\": false,\n \"Lead_Source\": null,\n \"Tag\": [],\n \"Fax\": null,\n \"$approval_state\": \"approved\"\n }\n ],\n \"info\": {\n \"per_page\": 200,\n \"count\": 4,\n \"page\": 1,\n \"more_records\": false\n }\n}"
},
{
"name": "INVALID_MODULE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deal/738964000002224056/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deal",
"738964000002224056",
"Contact_Roles"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Fri, 18 Jun 2021 13:16:04 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "110"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-store, no-cache, must-revalidate, private"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-06-18T13:56:39+00:00"
},
{
"key": "clientVersion",
"value": "4126581"
},
{
"key": "clientsubVersion",
"value": "4db5c971143ce609008746cb1d40f588"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_MODULE\",\n \"details\": {},\n \"message\": \"the module name given seems to be invalid\",\n \"status\": \"error\"\n}"
},
{
"name": "INVALID_REQUEST_METHOD",
"originalRequest": {
"method": "COPY",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deals/738964000002224056/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deals",
"738964000002224056",
"Contact_Roles"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Fri, 18 Jun 2021 13:16:31 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "124"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "X-Frame-Options",
"value": "deny"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_REQUEST_METHOD\",\n \"details\": {},\n \"message\": \"The http request method type is not a valid one\",\n \"status\": \"error\"\n}"
},
{
"name": "AUTHENTICATION_FAILURE",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deals/738964000002224056/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deals",
"738964000002224056",
"Contact_Roles"
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Fri, 18 Jun 2021 13:16:48 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "98"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-cache"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-Download-Options",
"value": "noopen"
}
],
"cookie": [
],
"body": "{\n \"code\": \"AUTHENTICATION_FAILURE\",\n \"details\": {},\n \"message\": \"Authentication failed\",\n \"status\": \"error\"\n}"
},
{
"name": "INVALID_DATA",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{api-domain}}/crm/v2/Deals/73896400000222405/Contact_Roles",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2",
"Deals",
"73896400000222405",
"Contact_Roles"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "ZGS"
},
{
"key": "Date",
"value": "Fri, 18 Jun 2021 13:17:03 GMT"
},
{
"key": "Content-Type",
"value": "application/json;charset=utf-8"
},
{
"key": "Content-Length",
"value": "107"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Referrer-Policy",
"value": "strict-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Pragma",
"value": "no-cache"
},
{
"key": "Cache-Control",
"value": "no-store, no-cache, must-revalidate, private"
},
{
"key": "Expires",
"value": "Thu, 01 Jan 1970 00:00:00 GMT"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "X-ACCESSTOKEN-RESET",
"value": "2021-06-18T13:56:39+00:00"
},
{
"key": "clientVersion",
"value": "4126581"
},
{
"key": "clientsubVersion",
"value": "4db5c971143ce609008746cb1d40f588"
},
{
"key": "Content-Disposition",
"value": "attachment; filename=response.json"
},
{
"key": "X-Download-Options",
"value": "noopen"
},
{
"key": "Content-Language",
"value": "en-US"
}
],
"cookie": [
],
"body": "{\n \"code\": \"INVALID_DATA\",\n \"details\": {},\n \"message\": \"the related id given seems to be invalid\",\n \"status\": \"error\"\n}"
}
]
}