Class: GongAPI::CRMApi

Inherits:
Object
  • Object
show all
Defined in:
lib/gong_api/api/crm_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CRMApi

Returns a new instance of CRMApi.



16
17
18
# File 'lib/gong_api/api/crm_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/gong_api/api/crm_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#delete_generic_crm_integration_using_delete(client_request_id, integration_id, opts = {}) ⇒ AsyncProcessingResponse

Delete a Generic CRM integration (/v2/crm/integration/delete) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Deletes a Generic CRM integration and all its associated crm objects (Accounts, Contacts, Deals, Leads, and Users).</p><p>This API is asynchronous. Call "/request-status" API with the clientRequestId sent to this API to track progress of the delete request:
Status DONE indicates that the integration and all its associated crm objects have been successfully deleted. Calls associations may take up to 24 hours to be deleted.</p><h3>Example</h3><h4>Request</h4>DELETE https://api.gong.io/v2/crm/integration/delete?clientRequestId=1234&integrationId=6286478263646<p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:integration:delete’.</p>

Parameters:

  • client_request_id

    A unique identifier sent by you to allow troubleshooting requests. Valid characters for this field are letters, numbers, dashes and underscores.

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



25
26
27
28
# File 'lib/gong_api/api/crm_api.rb', line 25

def delete_generic_crm_integration_using_delete(client_request_id, integration_id, opts = {})
  data, _status_code, _headers = delete_generic_crm_integration_using_delete_with_http_info(client_request_id, integration_id, opts)
  data
end

#delete_generic_crm_integration_using_delete_with_http_info(client_request_id, integration_id, opts = {}) ⇒ Array<(AsyncProcessingResponse, Integer, Hash)>

Delete a Generic CRM integration (/v2/crm/integration/delete) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Deletes a Generic CRM integration and all its associated crm objects (Accounts, Contacts, Deals, Leads, and Users).&lt;/p&gt;&lt;p&gt;This API is asynchronous. Call &quot;/request-status&quot; API with the clientRequestId sent to this API to track progress of the delete request:&lt;br&gt;Status DONE indicates that the integration and all its associated crm objects have been successfully deleted. Calls associations may take up to 24 hours to be deleted.&lt;/p&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;DELETE api.gong.io/v2/crm/integration/delete?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&lt;/code&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:integration:delete&#x27;.&lt;/p&gt;

Parameters:

  • client_request_id

    A unique identifier sent by you to allow troubleshooting requests. Valid characters for this field are letters, numbers, dashes and underscores.

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(AsyncProcessingResponse, Integer, Hash)>)

    AsyncProcessingResponse data, response status code and response headers



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/gong_api/api/crm_api.rb', line 36

def delete_generic_crm_integration_using_delete_with_http_info(client_request_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.delete_generic_crm_integration_using_delete ...'
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling CRMApi.delete_generic_crm_integration_using_delete"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.delete_generic_crm_integration_using_delete"
  end
  # resource path
  local_var_path = '/v2/crm/integration/delete'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'clientRequestId'] = client_request_id
  query_params[:'integrationId'] = integration_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'AsyncProcessingResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#delete_generic_crm_integration_using_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_crm_objects_using_get(body, integration_id, object_type, opts = {}) ⇒ GetGenericCrmObjectsResponse

Get CRM objects (/v2/crm/object/list) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>This API is intended to be used in development phase only, to manually verify that objects are uploaded and processed correctly in Gong.</p><p>Returns a JSON object where each key is the object crm id and the corresponding value is a nested JSON object representing the CRM object fields. Each key in the nested JSON is the field name and the corresponding value is the field value.</p><p>The objects are fetched from the Gong main DB. If the object is not found, the JSON’s value will be null.</p><p>The request body contains an array of objects ids.</p><p>The request is limited to 100 objects. If more than 100 objects are requested only the first 100 are returned.</p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:get-objects’.</p>

Parameters:

  • body

    Requested objects crm ids

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Requested objects type

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



90
91
92
93
# File 'lib/gong_api/api/crm_api.rb', line 90

def get_crm_objects_using_get(body, integration_id, object_type, opts = {})
  data, _status_code, _headers = get_crm_objects_using_get_with_http_info(body, integration_id, object_type, opts)
  data
end

#get_crm_objects_using_get_with_http_info(body, integration_id, object_type, opts = {}) ⇒ Array<(GetGenericCrmObjectsResponse, Integer, Hash)>

Get CRM objects (/v2/crm/object/list) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;This API is intended to be used in &lt;b&gt;development phase only&lt;/b&gt;, to manually verify that objects are uploaded and processed correctly in Gong.&lt;/p&gt;&lt;p&gt;Returns a JSON object where each key is the object crm id and the corresponding value is a nested JSON object representing the CRM object fields. Each key in the nested JSON is the field name and the corresponding value is the field value.&lt;/p&gt;&lt;p&gt;The objects are fetched from the Gong main DB. If the object is not found, the JSON’s value will be null.&lt;/p&gt;&lt;p&gt;The request body contains an array of objects ids.&lt;/p&gt;&lt;p&gt;The request is limited to 100 objects. If more than 100 objects are requested only the first 100 are returned.&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:get-objects&#x27;.&lt;/p&gt;

Parameters:

  • body

    Requested objects crm ids

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Requested objects type

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/gong_api/api/crm_api.rb', line 102

def get_crm_objects_using_get_with_http_info(body, integration_id, object_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.get_crm_objects_using_get ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.get_crm_objects_using_get"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.get_crm_objects_using_get"
  end
  # verify the required parameter 'object_type' is set
  if @api_client.config.client_side_validation && object_type.nil?
    fail ArgumentError, "Missing the required parameter 'object_type' when calling CRMApi.get_crm_objects_using_get"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['ACCOUNT', 'CONTACT', 'DEAL', 'LEAD'].include?(object_type)
    fail ArgumentError, "invalid value for 'object_type', must be one of ACCOUNT, CONTACT, DEAL, LEAD"
  end
  # resource path
  local_var_path = '/v2/crm/object/list'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'integrationId'] = integration_id
  query_params[:'objectType'] = object_type

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'GetGenericCrmObjectsResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#get_crm_objects_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_request_status_using_get(client_request_id, integration_id, opts = {}) ⇒ RequestStatusResponse

Get Request Status (/v2/crm/request-status) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Returns the current status of the request for "/map/users", "/object/entities" or "/integration/delete" API.</p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:upload’.</p><h3>Status Codes</h3><ul> <li><span class=‘public-api-parameter’>PENDING</span> - File is pending parsing</li> <li><span class=‘public-api-note’>IN_PROGRESS</span> - File is being parsed</li> <li><span class=‘public-api-info’>DONE</span> - All objects in the file were successfully parsed</li> <li><span class=‘public-api-critical’>FAILED</span> - Failed to parse some objects in the file or on a general error when the file was being processed</li></ul><h3>Status Indication</h3><ul> <li>For "/object/entities" API, status <span class=‘public-api-info’>DONE</span> indicates that all objects in the LDJSON file were successfully parsed and stored in raw storage.
Note that it can take up to 1 hour from the time the LDJSON file was uploaded using the "/object/entities" API until deals are fully processed and available to the end user on the Deals Board. </li> <li>For "/map/users" API, status <span class=‘public-api-info’>DONE</span> indicates that the mapping was successfully created and is available in Gong for the processing of other objects.</li> <li><span class=‘public-api-critical’>FAILED</span>: <ul> <li>If you receive a <span class=‘public-api-critical’>FAILED</span> status with a specific error list there are errors you need to address in the object: <ul> <li>Fix the objects’ JSON.</li> <li>Resend the entire LDJSON file to "/object/entities" or "/map/users" API.
Note that The returned errors list is limited to the first 20 errors. To make sure you have corrected all the possible errors you need to upload the entire file repeatedly until you receive a <span class=‘public-api-info’>DONE</span> status. </li> </ul> </li> <li>If you received a <span class=‘public-api-critical’>FAILED</span> status with a single error in the form of
GongAPI::CRMApi."line":0,"description":""line":0,"description":".…"line":0,"description":".…." this indicates a general processing error: <ul> <li>Fix the LDJSON file according to the error message.</li> <li>Upload the entire LDJSON file again.</li> </ul> </li> </ul> </li></ul>

Parameters:

  • client_request_id

    &lt;span style&#x3D;&#x27;background: rgba(9,30,66,0.08)&#x27;&gt;clientRequestId&lt;/span&gt; sent to &quot;/map/users&quot;, &quot;/object/entities&quot; or &quot;/integration/delete&quot; API

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



165
166
167
168
# File 'lib/gong_api/api/crm_api.rb', line 165

def get_request_status_using_get(client_request_id, integration_id, opts = {})
  data, _status_code, _headers = get_request_status_using_get_with_http_info(client_request_id, integration_id, opts)
  data
end

#get_request_status_using_get_with_http_info(client_request_id, integration_id, opts = {}) ⇒ Array<(RequestStatusResponse, Integer, Hash)>

Get Request Status (/v2/crm/request-status) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Returns the current status of the request for &quot;/map/users&quot;, &quot;/object/entities&quot; or &quot;/integration/delete&quot; API.&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:upload&#x27;.&lt;/p&gt;&lt;h3&gt;Status Codes&lt;/h3&gt;&lt;ul&gt; &lt;li&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;PENDING&lt;/span&gt; - File is pending parsing&lt;/li&gt; &lt;li&gt;&lt;span class&#x3D;&#x27;public-api-note&#x27;&gt;IN_PROGRESS&lt;/span&gt; - File is being parsed&lt;/li&gt; &lt;li&gt;&lt;span class&#x3D;&#x27;public-api-info&#x27;&gt;DONE&lt;/span&gt; - All objects in the file were successfully parsed&lt;/li&gt; &lt;li&gt;&lt;span class&#x3D;&#x27;public-api-critical&#x27;&gt;FAILED&lt;/span&gt; - Failed to parse some objects in the file or on a general error when the file was being processed&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Status Indication&lt;/h3&gt;&lt;ul&gt; &lt;li&gt;For &quot;/object/entities&quot; API, status &lt;span class&#x3D;&#x27;public-api-info&#x27;&gt;DONE&lt;/span&gt; indicates that all objects in the LDJSON file were successfully parsed and stored in raw storage.&lt;br&gt; Note that it can take up to 1 hour from the time the LDJSON file was uploaded using the &quot;/object/entities&quot; API until deals are fully processed and available to the end user on the Deals Board. &lt;/li&gt; &lt;li&gt;For &quot;/map/users&quot; API, status &lt;span class&#x3D;&#x27;public-api-info&#x27;&gt;DONE&lt;/span&gt; indicates that the mapping was successfully created and is available in Gong for the processing of other objects.&lt;/li&gt; &lt;li&gt;&lt;span class&#x3D;&#x27;public-api-critical&#x27;&gt;FAILED&lt;/span&gt;: &lt;ul&gt; &lt;li&gt;If you receive a &lt;span class&#x3D;&#x27;public-api-critical&#x27;&gt;FAILED&lt;/span&gt; status with a specific error list there are errors you need to address in the object: &lt;ul&gt; &lt;li&gt;Fix the objects&#x27; JSON.&lt;/li&gt; &lt;li&gt;Resend the entire LDJSON file to &quot;/object/entities&quot; or &quot;/map/users&quot; API.&lt;br&gt; Note that The returned errors list is &lt;b&gt;limited to the first 20 errors&lt;/b&gt;. To make sure you have corrected all the possible errors you need to upload the entire file repeatedly until you receive a &lt;span class&#x3D;&#x27;public-api-info&#x27;&gt;DONE&lt;/span&gt; status. &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;If you received a &lt;span class&#x3D;&#x27;public-api-critical&#x27;&gt;FAILED&lt;/span&gt; status with a single error in the form of&lt;br&gt; GongAPI::CRMApi.&quot;line&quot;:0,&quot;description&quot;:&quot;&quot;line&quot;:0,&quot;description&quot;:&quot;.…&quot;line&quot;:0,&quot;description&quot;:&quot;.….&quot; this indicates a general processing error: &lt;ul&gt; &lt;li&gt;Fix the LDJSON file according to the error message.&lt;/li&gt; &lt;li&gt;Upload the entire LDJSON file again.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt;&lt;/ul&gt;

Parameters:

  • client_request_id

    &lt;span style&#x3D;&#x27;background: rgba(9,30,66,0.08)&#x27;&gt;clientRequestId&lt;/span&gt; sent to &quot;/map/users&quot;, &quot;/object/entities&quot; or &quot;/integration/delete&quot; API

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RequestStatusResponse, Integer, Hash)>)

    RequestStatusResponse data, response status code and response headers



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/gong_api/api/crm_api.rb', line 176

def get_request_status_using_get_with_http_info(client_request_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.get_request_status_using_get ...'
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling CRMApi.get_request_status_using_get"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.get_request_status_using_get"
  end
  # resource path
  local_var_path = '/v2/crm/request-status'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'clientRequestId'] = client_request_id
  query_params[:'integrationId'] = integration_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'RequestStatusResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#get_request_status_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_crm_schema_fields_using_get(integration_id, object_type, opts = {}) ⇒ ListSelectedFieldsResponse

List Schema Fields (/v2/crm/object/schema/list) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Retrieves a list of the object schema fields.</p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:schema’.</p><h3>Example</h3><h4>Request</h4>GET https://api.gong.io/v2/crm/object/schema/list?integrationId=6286478263646&objectType=ACCOUNT<h4>Response</h4>{ \"requestId\": \"afjkzqkqglog7ueki5\", \"selectedFields\": { \"ACCOUNT\": [ { \"name\": \"accountTypePicklist\", \"label\": \"Account Type\", \"type\": \"PICKLIST\", \"lastModified\": null, \"isDeleted\": false, \"referenceTo\": null, \"orderedValueList\": null }, { \"name\": \"accountTypePicklist2\", \"label\": \"Account Type2\", \"type\": \"PICKLIST\", \"lastModified\": null, \"isDeleted\": false, \"referenceTo\": null, \"orderedValueList\": null }, { \"name\": \"fooBar\", \"label\": \"Foo Bar\", \"type\": \"STRING\", \"lastModified\": null, \"isDeleted\": false, \"referenceTo\": null, \"orderedValueList\": null } ] }}

Parameters:

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Type of object to retrieve the schema fields for (case-sensitive). &lt;br&gt;Omitting this parameter returns the schema for all object types.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



229
230
231
232
# File 'lib/gong_api/api/crm_api.rb', line 229

def list_crm_schema_fields_using_get(integration_id, object_type, opts = {})
  data, _status_code, _headers = list_crm_schema_fields_using_get_with_http_info(integration_id, object_type, opts)
  data
end

#list_crm_schema_fields_using_get_with_http_info(integration_id, object_type, opts = {}) ⇒ Array<(ListSelectedFieldsResponse, Integer, Hash)>

List Schema Fields (/v2/crm/object/schema/list) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Retrieves a list of the object schema fields.&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:schema&#x27;.&lt;/p&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;GET api.gong.io/v2/crm/object/schema/list?integrationId&#x3D;6286478263646&amp;objectType&#x3D;ACCOUNT&lt;/code&gt;&lt;h4&gt;Response&lt;/h4&gt;&lt;code&gt;{ &quot;requestId&quot;: &quot;afjkzqkqglog7ueki5&quot;, &quot;selectedFields&quot;: { &quot;ACCOUNT&quot;: [ { &quot;name&quot;: &quot;accountTypePicklist&quot;, &quot;label&quot;: &quot;Account Type&quot;, &quot;type&quot;: &quot;PICKLIST&quot;, &quot;lastModified&quot;: null, &quot;isDeleted&quot;: false, &quot;referenceTo&quot;: null, &quot;orderedValueList&quot;: null }, { &quot;name&quot;: &quot;accountTypePicklist2&quot;, &quot;label&quot;: &quot;Account Type2&quot;, &quot;type&quot;: &quot;PICKLIST&quot;, &quot;lastModified&quot;: null, &quot;isDeleted&quot;: false, &quot;referenceTo&quot;: null, &quot;orderedValueList&quot;: null }, { &quot;name&quot;: &quot;fooBar&quot;, &quot;label&quot;: &quot;Foo Bar&quot;, &quot;type&quot;: &quot;STRING&quot;, &quot;lastModified&quot;: null, &quot;isDeleted&quot;: false, &quot;referenceTo&quot;: null, &quot;orderedValueList&quot;: null } ] }}&lt;/code&gt;

Parameters:

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Type of object to retrieve the schema fields for (case-sensitive). &lt;br&gt;Omitting this parameter returns the schema for all object types.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ListSelectedFieldsResponse, Integer, Hash)>)

    ListSelectedFieldsResponse data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/gong_api/api/crm_api.rb', line 240

def list_crm_schema_fields_using_get_with_http_info(integration_id, object_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.list_crm_schema_fields_using_get ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.list_crm_schema_fields_using_get"
  end
  # verify the required parameter 'object_type' is set
  if @api_client.config.client_side_validation && object_type.nil?
    fail ArgumentError, "Missing the required parameter 'object_type' when calling CRMApi.list_crm_schema_fields_using_get"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['ACCOUNT', 'CONTACT', 'DEAL', 'LEAD'].include?(object_type)
    fail ArgumentError, "invalid value for 'object_type', must be one of ACCOUNT, CONTACT, DEAL, LEAD"
  end
  # resource path
  local_var_path = '/v2/crm/object/schema/list'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'integrationId'] = integration_id
  query_params[:'objectType'] = object_type

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'ListSelectedFieldsResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#list_crm_schema_fields_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_generic_crm_integration_using_get(opts = {}) ⇒ ListGenericCrmIntegrationsResponse

Get Generic CRM integration details (/v2/crm/integration/list) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Returns a list of all active Generic CRM integrations of the company. Only integrations created with ‘Register a Generic CRM integration’ API are returned.
Only one active integration is currently supported.</p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:integrations:read’.</p>

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



295
296
297
298
# File 'lib/gong_api/api/crm_api.rb', line 295

def list_generic_crm_integration_using_get(opts = {})
  data, _status_code, _headers = list_generic_crm_integration_using_get_with_http_info(opts)
  data
end

#list_generic_crm_integration_using_get_with_http_info(opts = {}) ⇒ Array<(ListGenericCrmIntegrationsResponse, Integer, Hash)>

Get Generic CRM integration details (/v2/crm/integration/list) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Returns a list of all active Generic CRM integrations of the company. Only integrations created with &#x27;Register a Generic CRM integration&#x27; API are returned.&lt;br&gt;Only one active integration is currently supported.&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:integrations:read&#x27;.&lt;/p&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/gong_api/api/crm_api.rb', line 304

def list_generic_crm_integration_using_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.list_generic_crm_integration_using_get ...'
  end
  # resource path
  local_var_path = '/v2/crm/integration/list'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'ListGenericCrmIntegrationsResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#list_generic_crm_integration_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#map_crm_users_using_post(opts = {}) ⇒ AsyncProcessingResponse

Map Users (Deprecated) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>This API is Deprecated. Please use "/object/entities?objectType=BUSINESS_USER" API instead.</p><p>Gong associates users with the CRM User entity. Mapping users accurately is essential for Gong to connect users with all their associated objects in the CRM.</p><p>This API creates a mapping in Gong between the user ID in the CRM system and the user ID in Gong.</p>
<div class=‘public-api-important’>Important:<p>User mapping is important to ensure deals are processed in Gong correctly. Each uploaded deal contains an ownerId field, which contains a user ID from the CRM system.
Gong only processes a deal if this user ID is mapped to a user in Gong who is set to record or import calls.</p><p>Each request to this API must include the complete list of users from the CRM system.</p></div><p>If a user mapping is sent after a deal is uploaded:</p><ol> <li>Gong retroactively searches for deals whose ownerId matches the user ID mapping.</li> <li>Gong starts to reprocess those matched deals from raw storage into Gong’s main database.</li></ol><p>Gong matches the user from the uploaded JSON to a user in Gong based on the email address.</p><div class=‘public-api-info’><p>The user mapping will not be created when:</p><ul> <li>There is no user in Gong with the supplied email address</li> <li>Mapping already exists for the supplied email address</li></ul></div><p>To update an existing mapping:</p><ol> <li>Delete the existing mapping by sending an existing mapping with isDeleted=true.</li> <li>In a separate request send a new mapping for the email address.</li></ol><p>The request body is a file in LDJSON format, meaning the file should contain JSON objects - where each JSON object is on a separate line and represents a single user from the CRM system.</p><p>Request Body Specifications:</p><ul> <li>Content-Type should be multipart/form-data</li> <li>Maximum payload size: 200 megabytes</li> <li>The request body should include one parameter named "dataFile" which contains the LDJSON file.</li></ul><h3>Request parameters (QUERY-STRING parameters)</h3><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>clientRequestId</span></td> <td>A unique identifier sent by you to enable troubleshooting communication.
Gong uses this identifier to prevent repeated attempts to upload the same users list.
Valid characters for this field: Letters, numbers, dashes, and underscores. </td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>integrationId</span></td> <td>Integration ID generated when creating the integration</td> <td>long</td> <td>Y</td> </tr> </tbody></table><p>User JSON object requires the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>crmUserId</span></td> <td>User ID in the CRM system</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>emailAddress</span></td> <td>Must match an email address of a user in Gong. Not mandatory when isDeleted = true.</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>isDeleted</span></td> <td>"true" deletes the user mapping. Default = "false"</td> <td>boolean</td> <td>N</td> </tr> </tbody></table><h3>Response</h3>201 Created<table> <thead> <tr> <th>Name</th> <th>Data Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>clientRequestId</span></td> <td>string</td> <td>the <span class=‘public-api-parameter’>clientRequestId</span> sent in the request</td> </tr> <tr> <td><span class=‘public-api-parameter’>requestId</span></td> <td>string</td> <td>A Gong request reference Id, generated for this request</td> </tr> </tbody></table><div class=‘public-api-important’><p>Important: The users mapping API is asynchronous. A 201 response only indicates that the file successfully uploaded to Gong and is pending processing. Use the <span class=‘public-api-parameter’>clientRequestId</span> to troubleshoot failed requests and watch the request status using "/request-status" API.</p></div><h3>Error Codes</h3>400 - Malformed request
401 - Access denied
409 Conflict - clientRequestId already exists
429 - API request limit exceeded
500 - Internal Server Error<p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:upload’.</p><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/map/users?clientRequestId=1234&integrationId=6286478263646
{\"crmUserId\": \"2356ddfwe32\", \"emailAddress\": \"[email protected]\"}<br>{\"crmUserId\": \"67534ghf745\", \"isDeleted\": true} // remove user mapping for user 67534ghf745

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :data_file (String)

Returns:



346
347
348
349
# File 'lib/gong_api/api/crm_api.rb', line 346

def map_crm_users_using_post(opts = {})
  data, _status_code, _headers = map_crm_users_using_post_with_http_info(opts)
  data
end

#map_crm_users_using_post_with_http_info(opts = {}) ⇒ Array<(AsyncProcessingResponse, Integer, Hash)>

Map Users (Deprecated) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;This API is &lt;b&gt;Deprecated&lt;/b&gt;. Please use &quot;/object/entities?objectType&#x3D;BUSINESS_USER&quot; API instead.&lt;/p&gt;&lt;p&gt;Gong associates users with the CRM &lt;b&gt;User&lt;/b&gt; entity. Mapping users accurately is essential for Gong to connect users with all their associated objects in the CRM.&lt;/p&gt;&lt;p&gt;This API creates a mapping in Gong between the user ID in the CRM system and the user ID in Gong.&lt;/p&gt;&lt;br&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt;&lt;b&gt;Important:&lt;/b&gt;&lt;p&gt;User mapping is important to ensure deals are processed in Gong correctly. Each uploaded deal contains an ownerId field, which contains a user ID from the CRM system.&lt;br&gt;&lt;b&gt;Gong only processes a deal if this user ID is mapped to a user in Gong who is set to record or import calls.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Each request to this API must include the complete list of users from the CRM system.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;If a user mapping is sent after a deal is uploaded:&lt;/p&gt;&lt;ol&gt; &lt;li&gt;Gong retroactively searches for deals whose ownerId matches the user ID mapping.&lt;/li&gt; &lt;li&gt;Gong starts to reprocess those matched deals from raw storage into Gong’s main database.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Gong matches the user from the uploaded JSON to a user in Gong based on the email address.&lt;/p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;&lt;p&gt;The user mapping will not be created when:&lt;/p&gt;&lt;ul&gt; &lt;li&gt;There is no user in Gong with the supplied email address&lt;/li&gt; &lt;li&gt;Mapping already exists for the supplied email address&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;To update an existing mapping:&lt;/p&gt;&lt;ol&gt; &lt;li&gt;Delete the existing mapping by sending an existing mapping with isDeleted&#x3D;true.&lt;/li&gt; &lt;li&gt;In a separate request send a new mapping for the email address.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The request body is a file in LDJSON format, meaning the file should contain JSON objects - where each JSON object is on a separate line and represents a single user from the CRM system.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Body Specifications:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt; &lt;li&gt;Content-Type should be multipart/form-data&lt;/li&gt; &lt;li&gt;Maximum payload size: 200 megabytes&lt;/li&gt; &lt;li&gt;The request body should include one parameter named &quot;&lt;b&gt;dataFile&lt;/b&gt;&quot; which contains the LDJSON file.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Request parameters (QUERY-STRING parameters)&lt;/h3&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;A unique identifier sent by you to enable troubleshooting communication.&lt;br&gt; Gong uses this identifier to prevent repeated attempts to upload the same users list.&lt;br&gt; Valid characters for this field: Letters, numbers, dashes, and underscores. &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;integrationId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Integration ID generated when creating the integration&lt;/td&gt; &lt;td&gt;long&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;User JSON object requires the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;crmUserId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;User ID in the CRM system&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;emailAddress&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Must match an email address of a user in Gong. Not mandatory when isDeleted &#x3D; true.&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;isDeleted&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&quot;true&quot; deletes the user mapping. Default &#x3D; &quot;false&quot;&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Response&lt;/h3&gt;&lt;code&gt;201 Created&lt;/code&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;the &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt; sent in the request&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;requestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;A Gong request reference Id, generated for this request&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt;&lt;p&gt;&lt;b&gt;Important:&lt;/b&gt; The users mapping API is asynchronous. A 201 response only indicates that the file successfully uploaded to Gong and is pending processing. Use the &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt; to troubleshoot failed requests and watch the request status using &quot;/request-status&quot; API.&lt;/p&gt;&lt;/div&gt;&lt;h3&gt;Error Codes&lt;/h3&gt;400 - Malformed request&lt;br&gt;401 - Access denied&lt;br&gt;409 Conflict - clientRequestId already exists&lt;br&gt;429 - API request limit exceeded&lt;br&gt;500 - Internal Server Error&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:upload&#x27;.&lt;/p&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/map/users?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&quot;2356ddfwe32&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;&lt;br&gt;&quot;67534ghf745&quot;, &quot;isDeleted&quot;: true // remove user mapping for user 67534ghf745&lt;/code&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :data_file (String)

Returns:

  • (Array<(AsyncProcessingResponse, Integer, Hash)>)

    AsyncProcessingResponse data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/gong_api/api/crm_api.rb', line 356

def map_crm_users_using_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.map_crm_users_using_post ...'
  end
  # resource path
  local_var_path = '/v2/crm/map/users'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['dataFile'] = opts[:'data_file'] if !opts[:'data_file'].nil?

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'AsyncProcessingResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#map_crm_users_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_generic_crm_integration_using_put(body, opts = {}) ⇒ RegisterGenericCrmResponse

Register a Generic CRM integration (/v2/crm/integration/new) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Register the CRM application in Gong and use the returned integrationId in future requests to the CRM API to correlate the data with the specific CRM.</p><p>Multiple CRM integrations are not currently supported. To create a new integration, first delete the old one.</p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:integration:register’.</p>

Parameters:

  • body

    registrationRequest

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



401
402
403
404
# File 'lib/gong_api/api/crm_api.rb', line 401

def register_generic_crm_integration_using_put(body, opts = {})
  data, _status_code, _headers = register_generic_crm_integration_using_put_with_http_info(body, opts)
  data
end

#register_generic_crm_integration_using_put_with_http_info(body, opts = {}) ⇒ Array<(RegisterGenericCrmResponse, Integer, Hash)>

Register a Generic CRM integration (/v2/crm/integration/new) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Register the CRM application in Gong and use the returned integrationId in future requests to the CRM API to correlate the data with the specific CRM.&lt;/p&gt;&lt;p&gt;Multiple CRM integrations are not currently supported. To create a new integration, first delete the old one.&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:integration:register&#x27;.&lt;/p&gt;

Parameters:

  • body

    registrationRequest

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RegisterGenericCrmResponse, Integer, Hash)>)

    RegisterGenericCrmResponse data, response status code and response headers



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/gong_api/api/crm_api.rb', line 411

def register_generic_crm_integration_using_put_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.register_generic_crm_integration_using_put ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.register_generic_crm_integration_using_put"
  end
  # resource path
  local_var_path = '/v2/crm/integration/new'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'RegisterGenericCrmResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#register_generic_crm_integration_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_crm_data_using_post(opts = {}) ⇒ AsyncProcessingResponse

Upload CRM objects (/v2/crm/object/entities) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>Inserts, updates, or deletes a CRM object in Gong.
If an existing object with the same id is detected it will be updated, otherwise it will be inserted as a new object.</p><p>The request body is a file in LDJSON format, meaning the file should contain JSON objects, where each JSON object is in a separate line and represents a single CRM object.</p><p>All objects in a single request should be of the same object type. An object cannot be contained more than once in a given list.</p><p>Request Body Specifications:</p><ul> <li>Content-Type should be multipart/form-data</li> <li>Maximum payload size: 200 megabytes</li> <li>The request body should contain one parameter named "dataFile" which holds the LDJSON file</li></ul><div class=‘public-api-important’><p>Important: The list must be sorted by modifiedDate Ascending.</p></div><div class=‘public-api-info’><p><ul> <li>On initial upload: Only send the items that weren’t deleted</li> <li>On subsequent (incremental) uploads: Send all items.</li></ul></p></div><div class=‘public-api-info’><p>Dates in the uploaded JSON objects are represented in ISO-8601 format without milliseconds (e.g. ‘2018-02-18T02:30:00-07:00’ or ‘2018-02-18T08:00:00Z’, where Z stands for UTC).</p></div><h3>Request parameters (QUERY-STRING parameters)</h3><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>integrationId</span></td> <td>Integration ID generated when creating the integration</td> <td>long</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>objectType</span></td> <td>Must be one of: "ACCOUNT", "CONTACT", "DEAL", "LEAD", "BUSINESS_USER", or "STAGE" (case-sensitive)</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>clientRequestId</span></td> <td>A unique identifier sent by you to allow troubleshooting communication.
Gong also uses this identifier to prevent repeated attempts to upload the same object list.
Valid characters for this field are letters, numbers, dashes and underscores. </td> <td>string</td> <td>Y</td> </tr> </tbody></table><h3>Response</h3>201 Created<table> <thead> <tr> <th>Name</th> <th>Data Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>clientRequestId</span></td> <td>string</td> <td>the <span class=‘public-api-parameter’>clientRequestId</span> sent in the request</td> </tr> <tr> <td><span class=‘public-api-parameter’>requestId</span></td> <td>string</td> <td>A Gong request reference Id, generated for this request</td> </tr> </tbody></table><div class=‘public-api-important’><p>Important: The upload objects API is asynchronous. A 201 response only indicates that the file successfully uploaded to Gong and is pending processing. Use the <span class=‘public-api-parameter’>clientRequestId</span> to troubleshoot failed requests and watch the request status using "/request-status" API.</p></div><h3>Error Codes</h3>400 - Malformed request
401 - Access denied
409 Conflict - clientRequestId already exists
429 - API request limit exceeded
500 - Internal Server Error<p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:upload’.</p><h2>Common CRM object fields</h2><p>All uploaded CRM objects should contain the following common JSON fields. In addition, each uploaded object should contain mandatory and optional fields as specified below for each object type.</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>objectId</span></td> <td>Each object must have a unique id field provided by the CRM.</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>modifiedDate</span></td> <td>The object’s last modification date and time in the CRM in ISO-8601 datetime format, without milliseconds</td> <td>datetime</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>lastModified</span>(Deprecated)</td> <td>Deprecated. Please use <span class=‘public-api-parameter’>modifiedDate</span></td> <td>datetime</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>isDeleted</span></td> <td>"true" deletes the object (For objectType=BUSINESS_USER deletes also the user mapping. For objectType=STAGE sets the stage to inactive). Default = "false"</td> <td>boolean</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>url</span></td> <td>A full http URL to browse this object in the CRM</td> <td>string (Qualified URI)</td> <td>N</td> </tr> </tbody></table><h2>Business User Object</h2><p>Gong associates users with the CRM User entity. Mapping users accurately is essential for Gong to connect users with all their associated objects in the CRM.</p><p>Uploading user objects via this API creates a mapping in Gong between the user ID in the CRM system and the user ID in Gong.</p>
<div class=‘public-api-important’> Important: <p>User mapping is important to ensure deals are processed in Gong correctly. Each uploaded deal contains an ownerId field, which contains a user ID from the CRM system.
Gong only processes a deal if this user ID is mapped to a user in Gong who is set to record or import calls. </p> <p>On initial upload send the complete list of users from the CRM system. On incremental upload send only users that have changed.</p></div><p>If a user is uploaded after a deal is uploaded:</p><ol> <li>Gong retroactively searches for deals whose ownerId matches the user ID mapping.</li> <li>Gong starts to reprocess those matched deals from raw storage into Gong’s main database.</li></ol><p>Gong matches the user from the uploaded JSON to a user in Gong based on the email address.</p><div class=‘public-api-info’> <p>The user mapping will not be created when:</p> <ul> <li>There is no user in Gong with the supplied email address</li> <li>Mapping already exists for the supplied email address</li> </ul></div><p>To update an existing mapping:</p><ol> <li>Delete the existing mapping by sending the user with isDeleted=true.</li> <li>In a separate request send the user with isDeleted=false and a new email address, or send a different user for the same email address.</li></ol><p>Business User JSON object requires the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>emailAddress</span></td> <td>Must match an email address of a user in Gong. Not mandatory when isDeleted = true.</td> <td>string</td> <td>Y</td> </tr> </tbody></table><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=BUSINESS_USER
{\"objectId\": \"user1_Id_In_The_CRM\", \"emailAddress\": \"[email protected]\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\"}<br> {\"objectId\": \"user2_Id_In_The_CRM\", \"isDeleted\": true, \"emailAddress\": \"[email protected]\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\"} // remove user mapping for user user2_Id_In_The_CRM<h2>Stage Object</h2><p>Update the list of stages from the CRM system.</p><p>Stages must be uploaded via this API before you upload Deal objects. When you upload your Deal object, make sure that the stage field matches one of the stages you’ve uploaded using this API.</p><div class=‘public-api-info’> <p>The upload stages request should only be sent after:</p> <ul> <li>You have created a new integration.</li> <li>There are any changes to the list of stages in the CRM. You can also send a stages update request before any request to the ‘/object/entities’ API.</li> </ul></div><p>Stage JSON object requires the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>internalName</span></td> <td>Unique name or unique identifier that identifies the stage in the CRM.</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>name</span></td> <td>Stage name (for display in Gong UI).</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>isActive</span></td> <td>Indicates if the stage is active in the CRM.</td> <td>boolean</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>sortOrder</span></td> <td>The order of the stage in the sales process (starting from 1).</td> <td>integer</td> <td>Y</td> </tr> </tbody></table><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=STAGE
{\"objectId\": \"discovery\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"internalName\": \"discovery\", \"name\": \"Discovery\", \"isActive\": true, \"sortOrder\": 1}<br> {\"objectId\": \"won\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"internalName\": \"won\", \"name\": \"Closed Won\", \"isActive\": true, \"sortOrder\": 5}<h2>Account Object</h2><ul> <li>The Account object represents an active customer in the CRM system.</li> <li>The Account object is used by Gong to connect activities such as emails and calls to their associated account.</li></ul><p>The Deals page displays all the activities in Gong associated with an account as well as account status, contacts, and insights.</p><div class=‘public-api-info’><p>Contacts and Deals are associated with accounts, and their processing in Gong requires the associated account.</p><p>In order for Deals to be processed correctly by Gong:<ol> <li>Upload Accounts.</li> <li>Wait 60 seconds.</li> <li>Upload Contacts and Deals.</li></ol></p></div><div class=‘public-api-critical’><p>When deals are being processed, the account referenced by Deal.accountId must exist in the Gong database.
If it does not exist in the database, the deal will not be processed or displayed in the Deals page and other areas throughout Gong.</p></div><p>The Account JSON object includes the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>name</span></td> <td>Account name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>domains</span></td> <td>Domain names related to the account</td> <td>string array</td> <td>Y</td> </tr> </tbody></table><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=ACCOUNT
{\"objectId\": \"5ybyh6n6n65\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"url\": \"https://crm.com/accounts/5ybyh6n6n65\", \"name\": \"PBR\", \"domains\": [\"pbr.com\", \"pbr.gov\"], \"type\": \"Investor\"} // account with additional field<br>{\"objectId\": \"gfjhty756th\", \"modifiedDate\": \"2019-01-03T22:45:57Z\", \"name\": \"PBR\", \"domains\": [\"pbr.com\", \"pbr.gov\"], \"isDeleted\": true} // remove account gfjhty756th from Gong<h2>Contact Object</h2><ul> <li>A contact in Gong is a person with contact details associated with the account.</li> <li>Gong uses a contact to match an activity to the correct account.</li></ul><p>The Contact JSON object includes the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>accountId</span></td> <td>The ID of the contact’s connected account in the CRM</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>emailAddress</span></td> <td>The contact’s main email address</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>firstName</span></td> <td>The contact’s first name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>lastName</span></td> <td>The contact’s last name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>title</span></td> <td>The contact’s title (if available)</td> <td>string</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>phoneNumber</span></td> <td>The contact’s main phone number.
If Gong is configured to import dialer calls the phoneNumber parameter is mandatory. </td> <td>string</td> <td>Y for dialer calls,
N otherwise </td> </tr> </tbody></table><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=CONTACT
{\"objectId\": \"5zbwd7n5n65\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"url\": \"https://crm.com/contacts/5zbwd7n5n65\", \"accountId\": \"5ybyh6n6n65\", \"emailAddress\": \"[email protected]\", \"firstName\": \"john\", \"lastName\": \"smith\", \"phoneNumber\": \"(912) 507-4395\"}<h2>Lead Object</h2><ul> <li>The Lead object represents a potential customer.</li> <li>Calls and emails are first associated with contacts based on email addresses.</li> <li>If there is no matching contact, Gong tries to match calls and emails to a lead.</li></ul><p>The Lead JSON object includes the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>emailAddress</span></td> <td>The Lead’s main email address</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>firstName</span></td> <td>The Lead’s first name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>lastName</span></td> <td>The Lead’s last name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>title</span></td> <td>The Lead’s title (if available)</td> <td>string</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>phoneNumber</span></td> <td>The Lead’s phone number.
If Gong is configured to import dialer calls the phoneNumber parameter is mandatory. </td> <td>string</td> <td>Y for dialer calls,
N otherwise </td> </tr> <tr> <td><span class=‘public-api-parameter’>convertedToDealId</span></td> <td>The deal CRM ID, if the lead was converted to a Deal</td> <td>string</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>convertedToContactId</span></td> <td>The contact CRM ID if the lead was converted to a Contact</td> <td>string</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>convertedToAccountId</span></td> <td>The account CRM ID if the lead was converted to an Account</td> <td>string</td> <td>N</td> </tr> </tbody></table><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=LEAD
{\"objectId\": \"4v5bt54t553\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"url\": \"https://crm.com/leads/45k4j5j5k44\", \"emailAddress\": \"[email protected]\", \"firstName\": \"Jane\", \"lastName\": \"Doe\", \"title\": \"VP Special Effects\", \"phoneNumber\": \"(912) 507-4395\"}<br>{\"objectId\": \"gf4543gf6th\", \"modifiedDate\": \"2019-01-03T22:45:57Z\", \"emailAddress\": \"[email protected]\", \"firstName\": \"John\", \"lastName\": \"Smith\", \"isDeleted\": true} // remove lead gf4543gf6th<br>{\"objectId\": \"63473hjg53h\", \"modifiedDate\": \"2019-01-03T23:45:57+01:00\", \"emailAddress\": \"[email protected]\", \"firstName\": \"Bob\", \"lastName\": \"Smith\", \"convertedToDealId\": \"dkfj8dfgf87\", \"convertedToContactId\": \"87grhn74hg6\", \"convertedToAccountId\": \"6sjk47jf78d\"} // lead 63473hjg53h converted to account 6sjk47jf78d, contact 87grhn74hg6 and deal dkfj8dfgf87<h2>Deal Object</h2><p>A deal in Gong represents a qualified opportunity or contract in a specific account.</p><p>The Deal JSON object includes the following fields:</p><table> <thead> <tr> <th>Name</th> <th>Description</th> <th>Data Type</th> <th>Mandatory</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>accountId</span></td> <td> <p>The ID of the account the deal is associated with in the CRM</p> <div class=‘public-api-info’> <p>An account with the same objectId must be uploaded first in order for the deal to be processed. The accountId needs to match an Account with the same value in its objectId.</p> </div> </td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>ownerId</span></td> <td> <p>The ID of the owning User in the CRM</p> <div class=‘public-api-info’> <p>This field is a reference to a CRM user which must be mapped to a Gong user via "/map/users" API and the Gong user must be set to record or import calls, otherwise the deal will not be processed</p> </div> </td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>name</span></td> <td>The deal’s name</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>createdDate</span></td> <td>The deal’s creation date and time (ISO-8601 datetime without milliseconds)</td> <td>datetime</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>estimatedCloseDate</span>*(Deprecated)</td> <td>Deprecated. Please use <span class=‘public-api-parameter’>closeDate</span> instead</td> <td>date</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>actualCloseDate</span>*(Deprecated)</td> <td>Deprecated. Please use <span class=‘public-api-parameter’>closeDate</span> instead</td> <td>date</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>closeDate</span></td> <td>The deal’s close date (ISO-8601), without time e.g. "2021-05-19"</td> <td>date</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>isOpen</span></td> <td>Indicates if the Deal’s status is Open or Closed</td> <td>boolean</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>isWon</span></td> <td>Indicates if the Deal’s status is Won or Lost</td> <td>boolean</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>stage</span></td> <td>The value of this field must be equal to the internalName of one of the stages uploaded via "/stages" API</td> <td>string</td> <td>Y</td> </tr> <tr> <td><span class=‘public-api-parameter’>estimatedAmount</span>**(Deprecated)</td> <td>Deprecated. Please use <span class=‘public-api-parameter’>amount</span> instead</td> <td>currency</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>actualAmount</span>**(Deprecated)</td> <td>Deprecated. Please use <span class=‘public-api-parameter’>amount</span> instead</td> <td>currency</td> <td>N</td> </tr> <tr> <td><span class=‘public-api-parameter’>amount</span></td> <td>The deal’s amount in the currency unit</td> <td>currency</td> <td>Y</td> </tr> </tbody></table><p>* Either <span class=‘public-api-parameter’>estimatedCloseDate</span> or <span class=‘public-api-parameter’>actualCloseDate</span> (or both) must exist in the JSON
** Either <span class=‘public-api-parameter’>estimatedAmount</span> or <span class=‘public-api-parameter’>actualAmount</span> (or both) must exist in the JSON</p><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/entities?clientRequestId=1234&integrationId=6286478263646&objectType=DEAL
{\"objectId\": \"8608553\", \"modifiedDate\": \"2022-02-04T18:24:59Z\", \"url\": \"http://crm.com/deals/8608553\", \"accountId\": \"5ybyh6n6n65\", \"ownerId\": \"5486951\", \"name\": \"Deal name\", \"createdDate\": \"2022-02-04T17:57:23Z\", \"closeDate\": \"2022-09-04\", \"isOpen\": true, \"isWon\": false, \"stage\": \"discovery\", \"amount\": 7000, \"custom_field_1\": \"2022-02-04T17:57:23.000Z\", \"custom_field_2\": null}<h2>Additional Fields</h2><p>In addition to the fields required by Gong, you can also add any other field to each object if the following two conditions are met:<ul> <li>The field name is defined in the object’s schema and has been uploaded using "/object/schema" API</li> <li>The field value matches the type defined in the schema</li></ul></p>

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :data_file (String)

Returns:



459
460
461
462
# File 'lib/gong_api/api/crm_api.rb', line 459

def upload_crm_data_using_post(opts = {})
  data, _status_code, _headers = upload_crm_data_using_post_with_http_info(opts)
  data
end

#upload_crm_data_using_post_with_http_info(opts = {}) ⇒ Array<(AsyncProcessingResponse, Integer, Hash)>

Upload CRM objects (/v2/crm/object/entities) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;Inserts, updates, or deletes a CRM object in Gong.&lt;br&gt;If an existing object with the same id is detected it will be updated, otherwise it will be inserted as a new object.&lt;/p&gt;&lt;p&gt;The request body is a file in LDJSON format, meaning the file should contain JSON objects, where each JSON object is in a separate line and represents a single CRM object.&lt;/p&gt;&lt;p&gt;All objects in a single request should be of the same object type. An object cannot be contained more than once in a given list.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Request Body Specifications:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt; &lt;li&gt;Content-Type should be multipart/form-data&lt;/li&gt; &lt;li&gt;Maximum payload size: 200 megabytes&lt;/li&gt; &lt;li&gt;The request body should contain one parameter named &quot;&lt;b&gt;dataFile&lt;/b&gt;&quot; which holds the LDJSON file&lt;/li&gt;&lt;/ul&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt;&lt;p&gt;&lt;b&gt;Important:&lt;/b&gt; The list must be sorted by modifiedDate Ascending.&lt;/p&gt;&lt;/div&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;&lt;p&gt;&lt;ul&gt; &lt;li&gt;On initial upload: Only send the items that weren’t deleted&lt;/li&gt; &lt;li&gt;On subsequent (incremental) uploads: Send all items.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;&lt;p&gt;Dates in the uploaded JSON objects are represented in ISO-8601 format without milliseconds (e.g. &#x27;2018-02-18T02:30:00-07:00&#x27; or &#x27;2018-02-18T08:00:00Z&#x27;, where Z stands for UTC).&lt;/p&gt;&lt;/div&gt;&lt;h3&gt;Request parameters (QUERY-STRING parameters)&lt;/h3&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;integrationId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Integration ID generated when creating the integration&lt;/td&gt; &lt;td&gt;long&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;objectType&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Must be one of: &quot;ACCOUNT&quot;, &quot;CONTACT&quot;, &quot;DEAL&quot;, &quot;LEAD&quot;, &quot;BUSINESS_USER&quot;, or &quot;STAGE&quot; (case-sensitive)&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;A unique identifier sent by you to allow troubleshooting communication.&lt;br&gt; Gong also uses this identifier to prevent repeated attempts to upload the same object list.&lt;br&gt; Valid characters for this field are letters, numbers, dashes and underscores. &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Response&lt;/h3&gt;&lt;code&gt;201 Created&lt;/code&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;the &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt; sent in the request&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;requestId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;A Gong request reference Id, generated for this request&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt;&lt;p&gt;&lt;b&gt;Important:&lt;/b&gt; The upload objects API is asynchronous. A 201 response only indicates that the file successfully uploaded to Gong and is pending processing. Use the &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;clientRequestId&lt;/span&gt; to troubleshoot failed requests and watch the request status using &quot;/request-status&quot; API.&lt;/p&gt;&lt;/div&gt;&lt;h3&gt;Error Codes&lt;/h3&gt;400 - Malformed request&lt;br&gt;401 - Access denied&lt;br&gt;409 Conflict - clientRequestId already exists&lt;br&gt;429 - API request limit exceeded&lt;br&gt;500 - Internal Server Error&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:upload&#x27;.&lt;/p&gt;&lt;h2&gt;Common CRM object fields&lt;/h2&gt;&lt;p&gt;All uploaded CRM objects should contain the following common JSON fields. In addition, each uploaded object should contain mandatory and optional fields as specified below for each object type.&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;objectId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Each object must have a unique id field provided by the CRM.&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;modifiedDate&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The object’s last modification date and time in the CRM in ISO-8601 datetime format, without milliseconds&lt;/td&gt; &lt;td&gt;datetime&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;lastModified&lt;/span&gt;&lt;b&gt;(Deprecated)&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Deprecated&lt;/b&gt;. Please use &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;modifiedDate&lt;/span&gt;&lt;/td&gt; &lt;td&gt;datetime&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;isDeleted&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&quot;true&quot; deletes the object (For objectType&#x3D;BUSINESS_USER deletes also the user mapping. For objectType&#x3D;STAGE sets the stage to inactive). Default &#x3D; &quot;false&quot;&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;url&lt;/span&gt;&lt;/td&gt; &lt;td&gt;A full http URL to browse this object in the CRM&lt;/td&gt; &lt;td&gt;string (Qualified URI)&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Business User Object&lt;/h2&gt;&lt;p&gt;Gong associates users with the CRM &lt;b&gt;User&lt;/b&gt; entity. Mapping users accurately is essential for Gong to connect users with all their associated objects in the CRM.&lt;/p&gt;&lt;p&gt;Uploading user objects via this API creates a mapping in Gong between the user ID in the CRM system and the user ID in Gong.&lt;/p&gt;&lt;br&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt; &lt;b&gt;Important:&lt;/b&gt; &lt;p&gt;User mapping is important to ensure deals are processed in Gong correctly. Each uploaded deal contains an ownerId field, which contains a user ID from the CRM system.&lt;br&gt; &lt;b&gt;Gong only processes a deal if this user ID is mapped to a user in Gong who is set to record or import calls.&lt;/b&gt; &lt;/p&gt; &lt;p&gt;On initial upload send the complete list of users from the CRM system. On incremental upload send only users that have changed.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;If a user is uploaded after a deal is uploaded:&lt;/p&gt;&lt;ol&gt; &lt;li&gt;Gong retroactively searches for deals whose ownerId matches the user ID mapping.&lt;/li&gt; &lt;li&gt;Gong starts to reprocess those matched deals from raw storage into Gong’s main database.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Gong matches the user from the uploaded JSON to a user in Gong based on the email address.&lt;/p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt; &lt;p&gt;The user mapping will not be created when:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;There is no user in Gong with the supplied email address&lt;/li&gt; &lt;li&gt;Mapping already exists for the supplied email address&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;p&gt;To update an existing mapping:&lt;/p&gt;&lt;ol&gt; &lt;li&gt;Delete the existing mapping by sending the user with isDeleted&#x3D;true.&lt;/li&gt; &lt;li&gt;In a separate request send the user with isDeleted&#x3D;false and a new email address, or send a different user for the same email address.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Business User JSON object requires the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;emailAddress&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Must match an email address of a user in Gong. Not mandatory when isDeleted &#x3D; true.&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;BUSINESS_USER&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt; &quot;user1_Id_In_The_CRM&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;&lt;br&gt; &quot;user2_Id_In_The_CRM&quot;, &quot;isDeleted&quot;: true, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot; // remove user mapping for user user2_Id_In_The_CRM&lt;/code&gt;&lt;h2&gt;Stage Object&lt;/h2&gt;&lt;p&gt;Update the list of stages from the CRM system.&lt;/p&gt;&lt;p&gt;Stages must be uploaded via this API before you upload Deal objects. When you upload your Deal object, make sure that the stage field matches one of the stages you’ve uploaded using this API.&lt;/p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt; &lt;p&gt;The upload stages request should only be sent after:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;You have created a new integration.&lt;/li&gt; &lt;li&gt;There are any changes to the list of stages in the CRM. You can also send a stages update request before any request to the &#x27;/object/entities&#x27; API.&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;p&gt;Stage JSON object requires the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;internalName&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Unique name or unique identifier that identifies the stage in the CRM.&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;name&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Stage name (for display in Gong UI).&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;isActive&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Indicates if the stage is active in the CRM.&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;sortOrder&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The order of the stage in the sales process (starting from 1).&lt;/td&gt; &lt;td&gt;integer&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;STAGE&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt; &quot;discovery&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;internalName&quot;: &quot;discovery&quot;, &quot;name&quot;: &quot;Discovery&quot;, &quot;isActive&quot;: true, &quot;sortOrder&quot;: 1&lt;br&gt; &quot;won&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;internalName&quot;: &quot;won&quot;, &quot;name&quot;: &quot;Closed Won&quot;, &quot;isActive&quot;: true, &quot;sortOrder&quot;: 5&lt;/code&gt;&lt;h2&gt;Account Object&lt;/h2&gt;&lt;ul&gt; &lt;li&gt;The Account object represents an active customer in the CRM system.&lt;/li&gt; &lt;li&gt;The Account object is used by Gong to connect activities such as emails and calls to their associated account.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The Deals page displays all the activities in Gong associated with an account as well as account status, contacts, and insights.&lt;/p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;&lt;p&gt;Contacts and Deals are associated with accounts, and their processing in Gong requires the associated account.&lt;/p&gt;&lt;p&gt;In order for Deals to be processed correctly by Gong:&lt;ol&gt; &lt;li&gt;Upload Accounts.&lt;/li&gt; &lt;li&gt;Wait 60 seconds.&lt;/li&gt; &lt;li&gt;Upload Contacts and Deals.&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class&#x3D;&#x27;public-api-critical&#x27;&gt;&lt;p&gt;When deals are being processed, the account referenced by Deal.accountId must exist in the Gong database.&lt;br&gt;If it does not exist in the database, the deal will not be processed or displayed in the Deals page and other areas throughout Gong.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;The Account JSON object includes the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;name&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Account name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;domains&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Domain names related to the account&lt;/td&gt; &lt;td&gt;string array&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;ACCOUNT&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&quot;5ybyh6n6n65&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;url&quot;: &quot;crm.com/accounts/5ybyh6n6n65&quot;, &quot;name&quot;: &quot;PBR&quot;, &quot;domains&quot;: [&quot;pbr.com&quot;, &quot;pbr.gov&quot;], &quot;type&quot;: &quot;Investor&quot; // account with additional field&lt;br&gt;&quot;gfjhty756th&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T22:45:57Z&quot;, &quot;name&quot;: &quot;PBR&quot;, &quot;domains&quot;: [&quot;pbr.com&quot;, &quot;pbr.gov&quot;], &quot;isDeleted&quot;: true // remove account gfjhty756th from Gong&lt;/code&gt;&lt;h2&gt;Contact Object&lt;/h2&gt;&lt;ul&gt; &lt;li&gt;A contact in Gong is a person with contact details associated with the account.&lt;/li&gt; &lt;li&gt;Gong uses a contact to match an activity to the correct account.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The Contact JSON object includes the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;accountId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The ID of the contact’s connected account in the CRM&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;emailAddress&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact’s main email address&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;firstName&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact’s first name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;lastName&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact’s last name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;title&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact’s title (if available)&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;phoneNumber&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact’s main phone number.&lt;br&gt; If Gong is configured to import dialer calls the phoneNumber parameter is mandatory. &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y for dialer calls,&lt;br&gt; N otherwise &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;CONTACT&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&quot;5zbwd7n5n65&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;url&quot;: &quot;crm.com/contacts/5zbwd7n5n65&quot;, &quot;accountId&quot;: &quot;5ybyh6n6n65&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;firstName&quot;: &quot;john&quot;, &quot;lastName&quot;: &quot;smith&quot;, &quot;phoneNumber&quot;: &quot;(912) 507-4395&quot;&lt;/code&gt;&lt;h2&gt;Lead Object&lt;/h2&gt;&lt;ul&gt; &lt;li&gt;The Lead object represents a potential customer.&lt;/li&gt; &lt;li&gt;Calls and emails are first associated with contacts based on email addresses.&lt;/li&gt; &lt;li&gt;If there is no matching contact, Gong tries to match calls and emails to a lead.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The Lead JSON object includes the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;emailAddress&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The Lead’s main email address&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;firstName&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The Lead’s first name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;lastName&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The Lead’s last name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;title&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The Lead’s title (if available)&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;phoneNumber&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The Lead’s phone number.&lt;br&gt; If Gong is configured to import dialer calls the phoneNumber parameter is mandatory. &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y for dialer calls,&lt;br&gt; N otherwise &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;convertedToDealId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The deal CRM ID, if the lead was converted to a Deal&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;convertedToContactId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The contact CRM ID if the lead was converted to a Contact&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;convertedToAccountId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The account CRM ID if the lead was converted to an Account&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;LEAD&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&quot;4v5bt54t553&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;url&quot;: &quot;crm.com/leads/45k4j5j5k44&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;firstName&quot;: &quot;Jane&quot;, &quot;lastName&quot;: &quot;Doe&quot;, &quot;title&quot;: &quot;VP Special Effects&quot;, &quot;phoneNumber&quot;: &quot;(912) 507-4395&quot;&lt;br&gt;&quot;gf4543gf6th&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T22:45:57Z&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;firstName&quot;: &quot;John&quot;, &quot;lastName&quot;: &quot;Smith&quot;, &quot;isDeleted&quot;: true // remove lead gf4543gf6th&lt;br&gt;&quot;63473hjg53h&quot;, &quot;modifiedDate&quot;: &quot;2019-01-03T23:45:57+01:00&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;firstName&quot;: &quot;Bob&quot;, &quot;lastName&quot;: &quot;Smith&quot;, &quot;convertedToDealId&quot;: &quot;dkfj8dfgf87&quot;, &quot;convertedToContactId&quot;: &quot;87grhn74hg6&quot;, &quot;convertedToAccountId&quot;: &quot;6sjk47jf78d&quot; // lead 63473hjg53h converted to account 6sjk47jf78d, contact 87grhn74hg6 and deal dkfj8dfgf87&lt;/code&gt;&lt;h2&gt;Deal Object&lt;/h2&gt;&lt;p&gt;A deal in Gong represents a qualified opportunity or contract in a specific account.&lt;/p&gt;&lt;p&gt;The Deal JSON object includes the following fields:&lt;/p&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Data Type&lt;/th&gt; &lt;th&gt;Mandatory&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;accountId&lt;/span&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;The ID of the account the deal is associated with in the CRM&lt;/p&gt; &lt;div class&#x3D;&#x27;public-api-info&#x27;&gt; &lt;p&gt;An account with the same objectId must be uploaded first in order for the deal to be processed. The accountId needs to match an Account with the same value in its objectId.&lt;/p&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;ownerId&lt;/span&gt;&lt;/td&gt; &lt;td&gt; &lt;p&gt;The ID of the owning User in the CRM&lt;/p&gt; &lt;div class&#x3D;&#x27;public-api-info&#x27;&gt; &lt;p&gt;This field is a reference to a CRM user which must be mapped to a Gong user via &quot;/map/users&quot; API and the Gong user must be set to record or import calls, otherwise the deal will not be processed&lt;/p&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;name&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The deal’s name&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;createdDate&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The deal’s creation date and time (ISO-8601 datetime without milliseconds)&lt;/td&gt; &lt;td&gt;datetime&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;estimatedCloseDate&lt;/span&gt;*&lt;b&gt;(Deprecated)&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Deprecated&lt;/b&gt;. Please use &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;closeDate&lt;/span&gt; instead&lt;/td&gt; &lt;td&gt;date&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;actualCloseDate&lt;/span&gt;*&lt;b&gt;(Deprecated)&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Deprecated&lt;/b&gt;. Please use &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;closeDate&lt;/span&gt; instead&lt;/td&gt; &lt;td&gt;date&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;closeDate&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The deal’s close date (ISO-8601), without time e.g. &quot;2021-05-19&quot;&lt;/td&gt; &lt;td&gt;date&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;isOpen&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Indicates if the Deal’s status is Open or Closed&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;isWon&lt;/span&gt;&lt;/td&gt; &lt;td&gt;Indicates if the Deal’s status is Won or Lost&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;stage&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The value of this field must be equal to the internalName of one of the stages uploaded via &quot;/stages&quot; API&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;estimatedAmount&lt;/span&gt;**&lt;b&gt;(Deprecated)&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Deprecated&lt;/b&gt;. Please use &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;amount&lt;/span&gt; instead&lt;/td&gt; &lt;td&gt;currency&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;actualAmount&lt;/span&gt;**&lt;b&gt;(Deprecated)&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;Deprecated&lt;/b&gt;. Please use &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;amount&lt;/span&gt; instead&lt;/td&gt; &lt;td&gt;currency&lt;/td&gt; &lt;td&gt;N&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;amount&lt;/span&gt;&lt;/td&gt; &lt;td&gt;The deal’s amount in the currency unit&lt;/td&gt; &lt;td&gt;currency&lt;/td&gt; &lt;td&gt;Y&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;* Either &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;estimatedCloseDate&lt;/span&gt; or &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;actualCloseDate&lt;/span&gt; (or both) must exist in the JSON&lt;br&gt;** Either &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;estimatedAmount&lt;/span&gt; or &lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;actualAmount&lt;/span&gt; (or both) must exist in the JSON&lt;/p&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/entities?clientRequestId&#x3D;1234&amp;integrationId&#x3D;6286478263646&amp;objectType&#x3D;DEAL&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&quot;8608553&quot;, &quot;modifiedDate&quot;: &quot;2022-02-04T18:24:59Z&quot;, &quot;url&quot;: &quot;crm.com/deals/8608553&quot;, &quot;accountId&quot;: &quot;5ybyh6n6n65&quot;, &quot;ownerId&quot;: &quot;5486951&quot;, &quot;name&quot;: &quot;Deal name&quot;, &quot;createdDate&quot;: &quot;2022-02-04T17:57:23Z&quot;, &quot;closeDate&quot;: &quot;2022-09-04&quot;, &quot;isOpen&quot;: true, &quot;isWon&quot;: false, &quot;stage&quot;: &quot;discovery&quot;, &quot;amount&quot;: 7000, &quot;custom_field_1&quot;: &quot;2022-02-04T17:57:23.000Z&quot;, &quot;custom_field_2&quot;: null&lt;/code&gt;&lt;h2&gt;Additional Fields&lt;/h2&gt;&lt;p&gt;In addition to the fields required by Gong, you can also add any other field to each object if the following two conditions are met:&lt;ul&gt; &lt;li&gt;The field name is defined in the object&#x27;s schema and has been uploaded using &quot;/object/schema&quot; API&lt;/li&gt; &lt;li&gt;The field value matches the type defined in the schema&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :data_file (String)

Returns:

  • (Array<(AsyncProcessingResponse, Integer, Hash)>)

    AsyncProcessingResponse data, response status code and response headers



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# File 'lib/gong_api/api/crm_api.rb', line 469

def upload_crm_data_using_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.upload_crm_data_using_post ...'
  end
  # resource path
  local_var_path = '/v2/crm/object/entities'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['dataFile'] = opts[:'data_file'] if !opts[:'data_file'].nil?

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'AsyncProcessingResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#upload_crm_data_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_crm_schema_field_using_post(body, integration_id, object_type, opts = {}) ⇒ SchemaUpdateResponse

Upload Object Schema (/v2/crm/object/schema) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>All CRM object fields in Gong must have a representative schema that describes the field (unique name, type, etc.).
Any field uploaded by the "Upload CRM objects" API ("/object/entities" path) that is not described in the schema will be stored in Gong’s raw data storage. However, it will not be parsed by Gong and it will not be available to the end user.</p><p>For new integrations created via "/integration/new" API, Gong creates a default schema for each object type (Contact, Account, Deal, Lead) that contains the mandatory and optional fields specified in this guide. See the Upload CRM objects API section for more information.
If there are additional fields for any object type that are needed by the end user, send their schema via this API.</p><p><div class=‘public-api-info’>The schema update request should be sent when:<ul> <li>You have created a new integration.</li> <li>There are changes to the schema of any object type. You can also send a schema update request before any request to the ‘/object/entities’ API.</li></ul></div></p><p><div class=‘public-api-important’>Each schema update request must contain the full schema from your CRM. Fields that were sent in previous requests and no longer exist in your CRM, should be sent in the schema request with "isDeleted=true" (only once).</div></p><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:schema’.</p><h3>Supported Field Types</h3><table> <thead> <tr> <th>Field Type</th> <th>Format in JSON</th> <th>Sample Values</th> </tr> </thead> <tbody> <tr> <td><span class=‘public-api-parameter’>BOOLEAN</span></td> <td>boolean</td> <td>true, false</td> </tr> <tr> <td><span class=‘public-api-parameter’>DATE</span></td> <td>string (ISO-8601 date without time)</td> <td>"2020-05-31"</td> </tr> <tr> <td><span class=‘public-api-parameter’>DATETIME</span></td> <td>string (ISO-8601 datetime without milliseconds)</td> <td>"2020-12-17T07:37:21+02:00"
"2020-12-17T05:37:21Z"</td> </tr> <tr> <td><span class=‘public-api-parameter’>PICKLIST</span></td> <td>string - one of the values in an orderedValueList</td> <td>"Analyst"</td> </tr> <tr> <td><span class=‘public-api-parameter’>NUMBER</span></td> <td>number</td> <td>45.66, 8453</td> </tr> <tr> <td><span class=‘public-api-parameter’>PERCENT</span></td> <td>number (between 0 to 100)</td> <td>67.3</td> </tr> <tr> <td><span class=‘public-api-parameter’>CURRENCY</span>*</td> <td>number</td> <td>34.68</td> </tr> <tr> <td><span class=‘public-api-parameter’>PHONENUMBER</span></td> <td>string</td> <td>"+14055766687"</td> </tr> <tr> <td><span class=‘public-api-parameter’>EMAILADDRESS</span></td> <td>string</td> <td>"[email protected]"</td> </tr> <tr> <td><span class=‘public-api-parameter’>REFERENCE</span></td> <td>string - the id of another object</td> <td>"48b009drax"</td> </tr> <tr> <td><span class=‘public-api-parameter’>ID</span></td> <td>string - the id of the object</td> <td>"843hf8484jr84htg"</td> </tr> <tr> <td><span class=‘public-api-parameter’>STRING</span></td> <td>string</td> <td>"whatever you want"</td> </tr> <tr> <td><span class=‘public-api-parameter’>STRINGARRAY</span>**</td> <td>array of strings</td> <td></td> </tr> <tr> <td><span class=‘public-api-parameter’>URL</span></td> <td>string</td> <td>"crm.com/account/6d4r578f"</td> </tr> </tbody></table><p>* In the integration send a number value, and specify the correct currency symbol in the Gong UI. Currently Gong does not support multiple currencies per company.
** Can only be used for Gong-defined fields.</p><h3>Example</h3><h4>Request</h4>POST https://api.gong.io/v2/crm/object/schema?integrationId=6286478263646&objectType=ACCOUNT
[{\"uniqueName\": \"orderId\", \"label\": \"ID\", \"type\": \"ID\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},<br>{\"uniqueName\": \"parentAccount\", \"label\": \"Main Account\", \"type\": \"REFERENCE\", \"referenceTo\": \"ACCOUNT\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},<br>{\"uniqueName\": \"category\", \"label\": \"Category\", \"type\": \"PICKLIST\", \"orderedValueList\": [\"Analyst\", \"Competitor\", \"Customer\", \"Integrator\", \"Investor\", \"Partner\", \"Other\"], \"lastModified\": \"2020-11-11T08:11:34+01:00\"}, // custom field<br>{\"uniqueName\": \"industry\", \"isDeleted\": true, \"lastModified\": \"2020-11-21T08:11:34+01:00\"}] // remove custom field

Parameters:

  • body

    fields

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Type of object to set the schema for (case-sensitive)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



516
517
518
519
# File 'lib/gong_api/api/crm_api.rb', line 516

def upload_crm_schema_field_using_post(body, integration_id, object_type, opts = {})
  data, _status_code, _headers = upload_crm_schema_field_using_post_with_http_info(body, integration_id, object_type, opts)
  data
end

#upload_crm_schema_field_using_post_with_http_info(body, integration_id, object_type, opts = {}) ⇒ Array<(SchemaUpdateResponse, Integer, Hash)>

Upload Object Schema (/v2/crm/object/schema) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;All CRM object fields in Gong must have a representative schema that describes the field (unique name, type, etc.). &lt;br&gt;Any field uploaded by the &quot;Upload CRM objects&quot; API (&quot;/object/entities&quot; path) that is not described in the schema will be stored in Gong’s raw data storage. However, it will not be parsed by Gong and it will not be available to the end user.&lt;/p&gt;&lt;p&gt;For new integrations created via &quot;/integration/new&quot; API, Gong creates a default schema for each object type (Contact, Account, Deal, Lead) that contains the mandatory and optional fields specified in this guide. See the &lt;b&gt;Upload CRM objects&lt;/b&gt; API section for more information.&lt;br&gt;If there are additional fields for any object type that are needed by the end user, send their schema via this API.&lt;/p&gt;&lt;p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;The schema update request should be sent when:&lt;ul&gt; &lt;li&gt;You have created a new integration.&lt;/li&gt; &lt;li&gt;There are changes to the schema of any object type. You can also send a schema update request before any request to the &#x27;/object/entities&#x27; API.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&lt;div class&#x3D;&#x27;public-api-important&#x27;&gt;Each schema update request must contain the full schema from your CRM. Fields that were sent in previous requests and no longer exist in your CRM, should be sent in the schema request with &quot;isDeleted&#x3D;true&quot; (only once).&lt;/div&gt;&lt;/p&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:schema&#x27;.&lt;/p&gt;&lt;h3&gt;Supported Field Types&lt;/h3&gt;&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Field Type&lt;/th&gt; &lt;th&gt;Format in JSON&lt;/th&gt; &lt;th&gt;Sample Values&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;BOOLEAN&lt;/span&gt;&lt;/td&gt; &lt;td&gt;boolean&lt;/td&gt; &lt;td&gt;true, false&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;DATE&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string (ISO-8601 date without time)&lt;/td&gt; &lt;td&gt;&quot;2020-05-31&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;DATETIME&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string (ISO-8601 datetime without milliseconds)&lt;/td&gt; &lt;td&gt;&quot;2020-12-17T07:37:21+02:00&quot;&lt;br&gt;&quot;2020-12-17T05:37:21Z&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;PICKLIST&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string - one of the values in an orderedValueList&lt;/td&gt; &lt;td&gt;&quot;Analyst&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;NUMBER&lt;/span&gt;&lt;/td&gt; &lt;td&gt;number&lt;/td&gt; &lt;td&gt;45.66, 8453&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;PERCENT&lt;/span&gt;&lt;/td&gt; &lt;td&gt;number (between 0 to 100)&lt;/td&gt; &lt;td&gt;67.3&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;CURRENCY&lt;/span&gt;*&lt;/td&gt; &lt;td&gt;number&lt;/td&gt; &lt;td&gt;34.68&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;PHONENUMBER&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;&quot;+14055766687&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;EMAILADDRESS&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;&quot;[email protected]&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;REFERENCE&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string - the id of another object&lt;/td&gt; &lt;td&gt;&quot;48b009drax&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;ID&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string - the id of the object&lt;/td&gt; &lt;td&gt;&quot;843hf8484jr84htg&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;STRING&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;&quot;whatever you want&quot;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;STRINGARRAY&lt;/span&gt;**&lt;/td&gt; &lt;td&gt;array of strings&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class&#x3D;&#x27;public-api-parameter&#x27;&gt;URL&lt;/span&gt;&lt;/td&gt; &lt;td&gt;string&lt;/td&gt; &lt;td&gt;&quot;crm.com/account/6d4r578f&quot;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;* In the integration send a number value, and specify the correct currency symbol in the Gong UI. Currently Gong does not support multiple currencies per company.&lt;br&gt;** Can only be used for Gong-defined fields.&lt;/p&gt;&lt;h3&gt;Example&lt;/h3&gt;&lt;h4&gt;Request&lt;/h4&gt;&lt;code&gt;POST api.gong.io/v2/crm/object/schema?integrationId&#x3D;6286478263646&amp;objectType&#x3D;ACCOUNT&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;[&quot;orderId&quot;, &quot;label&quot;: &quot;ID&quot;, &quot;type&quot;: &quot;ID&quot;, &quot;lastModified&quot;: &quot;2020-11-11T08:11:34+01:00&quot;,&lt;br&gt;&quot;parentAccount&quot;, &quot;label&quot;: &quot;Main Account&quot;, &quot;type&quot;: &quot;REFERENCE&quot;, &quot;referenceTo&quot;: &quot;ACCOUNT&quot;, &quot;lastModified&quot;: &quot;2020-11-11T08:11:34+01:00&quot;,&lt;br&gt;&quot;category&quot;, &quot;label&quot;: &quot;Category&quot;, &quot;type&quot;: &quot;PICKLIST&quot;, &quot;orderedValueList&quot;: [&quot;Analyst&quot;, &quot;Competitor&quot;, &quot;Customer&quot;, &quot;Integrator&quot;, &quot;Investor&quot;, &quot;Partner&quot;, &quot;Other&quot;], &quot;lastModified&quot;: &quot;2020-11-11T08:11:34+01:00&quot;, // custom field&lt;br&gt;&quot;industry&quot;, &quot;isDeleted&quot;: true, &quot;lastModified&quot;: &quot;2020-11-21T08:11:34+01:00&quot;] // remove custom field&lt;/code&gt;

Parameters:

  • body

    fields

  • integration_id

    Integration ID generated when creating the integration

  • object_type

    Type of object to set the schema for (case-sensitive)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SchemaUpdateResponse, Integer, Hash)>)

    SchemaUpdateResponse data, response status code and response headers



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/gong_api/api/crm_api.rb', line 528

def upload_crm_schema_field_using_post_with_http_info(body, integration_id, object_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.upload_crm_schema_field_using_post ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.upload_crm_schema_field_using_post"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.upload_crm_schema_field_using_post"
  end
  # verify the required parameter 'object_type' is set
  if @api_client.config.client_side_validation && object_type.nil?
    fail ArgumentError, "Missing the required parameter 'object_type' when calling CRMApi.upload_crm_schema_field_using_post"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['ACCOUNT', 'CONTACT', 'DEAL', 'LEAD'].include?(object_type)
    fail ArgumentError, "invalid value for 'object_type', must be one of ACCOUNT, CONTACT, DEAL, LEAD"
  end
  # resource path
  local_var_path = '/v2/crm/object/schema'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'integrationId'] = integration_id
  query_params[:'objectType'] = object_type

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'SchemaUpdateResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#upload_crm_schema_field_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_stages_using_post(body, integration_id, opts = {}) ⇒ SchemaUpdateResponse

Upload Stages (Deprecated) <style>.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}</style><p>This API is Deprecated. Please use "/object/entities?objectType=STAGE" API instead.</p><p>Update the list of stages from the CRM system.</p><p>This API must be called before you upload Deal objects. When you upload your Deal object, make sure that the stage field matches one of the stages you’ve uploaded using this API.</p><div class=‘public-api-info’><p>The upload stages request should only be sent after:</p><ul> <li>You have created a new integration.</li> <li>There are any changes to the list of stages in the CRM. You can also send a stages update request before any request to the ‘/object/entities’ API.</li></ul></div><p>When accessed using a bearer token, this endpoint requires the scope ‘api:crm:schema’.</p>

Parameters:

  • body

    stages

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



591
592
593
594
# File 'lib/gong_api/api/crm_api.rb', line 591

def upload_stages_using_post(body, integration_id, opts = {})
  data, _status_code, _headers = upload_stages_using_post_with_http_info(body, integration_id, opts)
  data
end

#upload_stages_using_post_with_http_info(body, integration_id, opts = {}) ⇒ Array<(SchemaUpdateResponse, Integer, Hash)>

Upload Stages (Deprecated) &lt;style&gt;.public-api-info { background: rgb(222, 235, 255);}.public-api-tip { background: rgb(227, 252, 239);}.public-api-parameter { background: rgba(9,30,66,0.08);}.public-api-note { background: rgb(234, 230, 255);}.public-api-important { background: rgb(255, 250, 230);}.public-api-critical { background: rgb(255, 235, 230);}table, th, td { border: 1px solid gray; border-collapse: collapse;}th, td { padding: 5px;}th { text-align: left;}&lt;/style&gt;&lt;p&gt;This API is &lt;b&gt;Deprecated&lt;/b&gt;. Please use &quot;/object/entities?objectType&#x3D;STAGE&quot; API instead.&lt;/p&gt;&lt;p&gt;Update the list of stages from the CRM system.&lt;/p&gt;&lt;p&gt;This API must be called before you upload Deal objects. When you upload your Deal object, make sure that the stage field matches one of the stages you’ve uploaded using this API.&lt;/p&gt;&lt;div class&#x3D;&#x27;public-api-info&#x27;&gt;&lt;p&gt;The upload stages request should only be sent after:&lt;/p&gt;&lt;ul&gt; &lt;li&gt;You have created a new integration.&lt;/li&gt; &lt;li&gt;There are any changes to the list of stages in the CRM. You can also send a stages update request before any request to the &#x27;/object/entities&#x27; API.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;When accessed using a bearer token, this endpoint requires the scope &#x27;api:crm:schema&#x27;.&lt;/p&gt;

Parameters:

  • body

    stages

  • integration_id

    Integration ID generated when creating the integration

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SchemaUpdateResponse, Integer, Hash)>)

    SchemaUpdateResponse data, response status code and response headers



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/gong_api/api/crm_api.rb', line 602

def upload_stages_using_post_with_http_info(body, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CRMApi.upload_stages_using_post ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CRMApi.upload_stages_using_post"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling CRMApi.upload_stages_using_post"
  end
  # resource path
  local_var_path = '/v2/crm/stages'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'integrationId'] = integration_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'SchemaUpdateResponse' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CRMApi#upload_stages_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end