# \CrmApi
All URIs are relative to *https://127.0.0.1:8443*
Method | HTTP request | Description
------------- | ------------- | -------------
[**delete_generic_crm_integration**](CrmApi.md#delete_generic_crm_integration) | **DELETE** /v2/crm/integrations | Delete a Generic CRM integration (/v2/crm/integrations)
[**get_crm_objects**](CrmApi.md#get_crm_objects) | **GET** /v2/crm/entities | Get CRM objects (/v2/crm/entities)
[**get_request_status**](CrmApi.md#get_request_status) | **GET** /v2/crm/request-status | Get Request Status (/v2/crm/request-status)
[**list_crm_schema_fields**](CrmApi.md#list_crm_schema_fields) | **GET** /v2/crm/entity-schema | List Schema Fields (/v2/crm/entity-schema)
[**list_generic_crm_integration**](CrmApi.md#list_generic_crm_integration) | **GET** /v2/crm/integrations | Get Generic CRM integration details (/v2/crm/integrations)
[**register_generic_crm_integration**](CrmApi.md#register_generic_crm_integration) | **PUT** /v2/crm/integrations | Register a Generic CRM integration (/v2/crm/integrations)
[**upload_crm_schema_field**](CrmApi.md#upload_crm_schema_field) | **POST** /v2/crm/entity-schema | Upload Object Schema (/v2/crm/entity-schema)
## delete_generic_crm_integration
> models::AsyncProcessingResponse delete_generic_crm_integration(integration_id, client_request_id)
Delete a Generic CRM integration (/v2/crm/integrations)
<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;}img { border: 2px solid #D3D5D9;}</style><p>Asynchronously deletes a CRM integration and all its associated CRM objects (Accounts, Contacts, Deals, Leads, and Users).</p><p>This endpoint gets the clientRequestId generated by you as the request identifier. Use this to check the status of the delete request by calling the <code>/request-status</code> endpoint,with the clientRequestId. </p><p>A status of DONE indicates that the integration and all its associated crm objects have been successfully deleted. This may take up to 24 hours to be deleted.</p><br>When accessed using a bearer token, this endpoint requires the 'api:crm:integration:delete' scope.<h2>Example</h2><code>DELETE https://api.gong.io/v2/crm/integrations?clientRequestId=1234&integrationId=6286478263646</code>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**integration_id** | **i64** | The ID of the integration to delete | [required] |
**client_request_id** | **String** | A unique identifier generated and sent by you to allow troubleshooting. Valid characters are letters, numbers, dashes and underscores. | [required] |
### Return type
[**models::AsyncProcessingResponse**](AsyncProcessingResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_crm_objects
> models::GetGenericCrmObjectsResponse get_crm_objects(integration_id, object_type, objects_crm_ids)
Get CRM objects (/v2/crm/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;}img { border: 2px solid #D3D5D9;}</style><h2>This API is for use in the <strong>development phase only</strong>, to manually verify that objects are uploaded and processed correctly in Gong.</h2><p>Returns a JSON object where each key is the object’s 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 is 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 'api:crm:get-objects' scope.</p><h3>Example</h3><h4>Request</h4><code>GET https://api.gong.io/v2/crm/entities?integrationId=6286478263646&objectType=DEAL</code><br><br><code>[\"1234\",\"8765\"] //request body</code>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**integration_id** | **i64** | Integration ID generated when creating the integration | [required] |
**object_type** | **String** | Requested objects type | [required] |
**objects_crm_ids** | [**Vec<String>**](String.md) | <b>Request Body:</b> The requested objects crm ids (should be sent in the request body) | [required] |
### Return type
[**models::GetGenericCrmObjectsResponse**](GetGenericCrmObjectsResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_request_status
> models::RequestStatusResponse get_request_status(integration_id, client_request_id)
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;}img { border: 2px solid #D3D5D9;}</style><p>Returns the current status of the request for endpoints run asynchronously: </p><ul> <li>POST /v2/crm/entities</li> <li>DELETE /v2/crm/integrations</li></ul><p>When accessed using a bearer token, this endpoint requires the 'api:crm:upload' scope.</p><h3>Status Codes</h3><ul> <li>PENDING: file is pending being processed</li> <li>IN_PROGRESS: file is being processed</li> <li>DONE: all objects in the file were successfully processed</li> <li>FAILED: failed to parse some objects, or a general error occurred when the file was being processed</li></ul><h3>Correcting a file that failed to be processed:</h3><p>When the status in the response is FAILED do one of the following: </p><ul> <li>If the response includes a list of errors, correct the errors in the file as follows: <ol> <li>Using the <code>errors.line</code> attribute, locate and correct the data in the JSON file.</li> <li>You can resend the entire LDJSON file, or only the corrected records via the relevant API. <br>Note: The response returns a maximum of 20 errors. To make sure you have corrected all errors, upload the entire file repeatedly until you receive a DONE status.</li> </ol> </li> <li>A single error in the form of: <br>{\"line\":0,\"description\":\".....\"} indicates a general processing error: <ol> <li>Fix the LDJSON file according to the error message.</li> <li>Upload the entire LDJSON file again.</li> </ol> </li></ul>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**integration_id** | **i64** | Integration ID generated when creating the integration | [required] |
**client_request_id** | **String** | The client request ID used in the asynchronous endpoint you want to get a status for | [required] |
### Return type
[**models::RequestStatusResponse**](RequestStatusResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_crm_schema_fields
> models::ListSelectedFieldsResponse list_crm_schema_fields(integration_id, object_type)
List Schema Fields (/v2/crm/entity-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;}img { border: 2px solid #D3D5D9;}</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><code>GET https://api.gong.io/v2/crm/entity-schema?integrationId=6286478263646&objectType=ACCOUNT</code><h4>Response</h4><code>{ \"requestId\": \"afjkzqkqglog7ueki5\", \"objectTypeToSelectedFields\": { \"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 } ] }}</code>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**integration_id** | **i64** | Integration ID generated when creating the integration | [required] |
**object_type** | **String** | Type of object to retrieve the schema fields for (case-sensitive). <br>Omitting this parameter returns the schema for all object types. | [required] |
### Return type
[**models::ListSelectedFieldsResponse**](ListSelectedFieldsResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## list_generic_crm_integration
> models::ListGenericCrmIntegrationsResponse list_generic_crm_integration()
Get Generic CRM integration details (/v2/crm/integrations)
<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;}img { border: 2px solid #D3D5D9;}</style><p>Returns the CRM integration you set up using the <code>PUT /v2/crm/integrations</code> endpoint. You can only have one integration at a time. </p><p>When accessed using a bearer token, this endpoint requires the 'api:crm:integrations:read' scope.</p>
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::ListGenericCrmIntegrationsResponse**](ListGenericCrmIntegrationsResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## register_generic_crm_integration
> models::RegisterGenericCrmResponse register_generic_crm_integration(generic_crm_registration_request)
Register a Generic CRM integration (/v2/crm/integrations)
<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;}img { border: 2px solid #D3D5D9;}</style><p>Creates your CRM integration with Gong. Returns an integrationId, which should be used in requests to the CRM API to enable correct association of CRM data.</p><p>Multiple CRM integrations are not supported. To create a new integration, delete the old one first (<code>DELETE /v2/crm/integrations</code>).</p><p>This includes if you have integrated with Gong using one of the native CRM integrations such as HubSpot or Salesforce.</p><p>When accessed using a bearer token, this endpoint requires the 'api:crm:integration:register' scope.</p>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**generic_crm_registration_request** | [**GenericCrmRegistrationRequest**](GenericCrmRegistrationRequest.md) | | [required] |
### Return type
[**models::RegisterGenericCrmResponse**](RegisterGenericCrmResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## upload_crm_schema_field
> models::BaseResponse upload_crm_schema_field(integration_id, object_type, generic_schema_field_request)
Upload Object Schema (/v2/crm/entity-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;}img { border: 2px solid #D3D5D9;}</style><p>Enables you to add, edit or remove fields to Gong CRM entities, so that you can display additional CRM data in Gong. Fields that are not included in the Gong CRM objects, and are uploaded without updating your schema, are not displayed in Gong.</p><p>Update your schema when:</p><ul> <li>You create 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 <code>/v2/crm/entities</code> API.</li></ul><p>When updating your schema:</p><ul> <li>Add or change field: include all fields you want in the schema, including those sent previously. Example: <table> <tr> <th>Date</th> <th>Action</th> <th>Result</th> </tr> <tr> <td>3/4/2023</td> <td>Send account schema with fieldA</td> <td>fieldA added to the account</td> </tr> <tr> <td>6/4/23</td> <td>Send account schema with fieldA and fieldB</td> <td>fieldA still included in account schema. fieldB added to the account</td> </tr> <tr> <td>8/4/23</td> <td>Send account schema with fieldC but without fieldA and fieldB</td> <td>Receive an error that you must include all fields in the schema</td> </tr> <tr> <td>15/4/23</td> <td>Send account schema with fieldB, fieldC, and isDeleted for fieldA</td> <td>fieldA and all it's data are deleted. fieldB and fieldC remain in the schema</td> </tr> </table> </li> <li>Changing a field: if you change the field type, a new field is created and the data associated with the original field is deleted. Other changes, such as the label do not result in data being deleted.</li> <li>Deleting a field: to delete a field and it's associated data, send the field with isDeleted = true</li></ul><p>When accessed using a bearer token, this endpoint requires the 'api:crm:schema' scope.</p><h2>Supported field types</h2><p>This table describes the field types that can be added to your schema</p><table> <tr><th>Field type</th><th>Format in JSON</th><th>Possible values</th></tr> <tr><td>BOOLEAN</td><td>boolean</td><td>true, false</td></tr> <tr><td>DATE</td><td>string (ISO-8601 date without time)</td><td>\"2020-05-31\"</td></tr> <tr><td>DATETIME</td><td>string (ISO-8601 datetime without milliseconds)</td><td>\"2020-12-17T07:37:21+02:00\"<p>\"2020-12-17T05:37:21Z\"</p></td></tr> <tr><td>PICKLIST</td><td>string - one of the values in an orderedValueList</td><td>\"Analyst\"</td></tr> <tr><td>NUMBER</td><td>number</td><td>45.66, 8453</td></tr> <tr><td>PERCENT</td><td>number (between 0 to 100)</td><td>67.3</td></tr> <tr><td>CURRENCY*</td><td>number</td><td>34.68</td></tr> <tr><td>PHONENUMBER</td><td>string</td><td>\"+14055766687\"</td></tr> <tr><td>EMAILADDRESS</td><td>string</td><td>\"john.doe@anywhere.com\"</td></tr> <tr><td>REFERENCE</td><td>string - the id of another object</td><td>\"48b009drax\"</td></tr> <tr><td>ID</td><td>string - the id of the object</td><td>\"843hf8484jr84htg\"</td></tr> <tr><td>STRING</td><td>string</td><td>\"whatever you want\"</td></tr> <tr><td>URL</td><td>string</td><td>\"https://crm.com/account/6d4r578f\"</td></tr></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.</p><h3>Example</h3><h4>Request</h4><p><code>POST https://api.gong.io/v2/crm/entity-schema?integrationId=6286478263646&objectType=ACCOUNT</code></p><p><code>[{\"uniqueName\": \"orderId\", \"label\": \"ID\", \"type\": \"ID\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},</code></p><p><code>{\"uniqueName\": \"parentAccount\", \"label\": \"Main Account\", \"type\": \"REFERENCE\", \"referenceTo\": \"ACCOUNT\", \"lastModified\": \"2020-11-11T08:11:34+01:00\"},</code></p><p><code>{\"uniqueName\": \"category\", \"label\": \"Category\", \"type\": \"PICKLIST\", \"orderedValueList\": [\"Analyst\", \"Competitor\", \"Customer\", \"Integrator\", \"Investor\", \"Partner\", \"Other\"], \"lastModified\": \"2020-11-11T08:11:34+01:00\"}, </code></p><p>// remove custom field</p><p><code>{\"uniqueName\": \"industry\", \"isDeleted\": true, \"label\": \"Industry\", \"type\": \"PICKLIST\", \"lastModified\": \"2020-11-21T08:11:34+01:00\"}] </code></p>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**integration_id** | **i64** | Integration ID generated when creating the integration | [required] |
**object_type** | **String** | The object type to set the schema for (case-sensitive) | [required] |
**generic_schema_field_request** | [**Vec<models::GenericSchemaFieldRequest>**](GenericSchemaFieldRequest.md) | | [required] |
### Return type
[**models::BaseResponse**](BaseResponse.md)
### Authorization
[BasicAuth](../README.md#BasicAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)