### API Pagination Example Source: https://developers.freshworks.com/crm/api/index This example demonstrates how to paginate through API responses that return lists of objects, such as contacts or deals. The 'page' parameter is added to the query string to specify the desired page number. ```URL https://domain.myfreshworks.com/crm/sales/api/contacts/view/[:view_id]?page=2 ``` -------------------------------- ### Authenticate API Request Source: https://developers.freshworks.com/crm/api/index Example of how to authenticate an API request using a curl command with an API key and specifying the content type. This is a common pattern for interacting with RESTful APIs. ```Bash curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET https://domain.myfreshworks.com/crm/sales/api/contacts/1 ``` -------------------------------- ### Response for Getting Related Products Source: https://developers.freshworks.com/crm/api/index Returns a list of products associated with a CPQ document. Each product object contains details like name, category, pricing, and custom fields. ```json { "products": [ { "id": 1, "name": "Sample Product", "category": "Hardware", "custom_field": { "cf_quantity": 10.0, "cf_rating": "4" }, "product_code": "sample_product", "sku_number": "sample_sku", "parent_product": 1, "territory_id": null, "valid_till": "2021-11-06T00:47:13-08:00", "is_active": true, "owner_id": 3, "is_deleted": false, "created_at": "2021-10-06T02:24:19-08:00", "updated_at": "2021-10-10T20:22:03-08:00", "pricing_type": 2, "product_pricings": [], "avatar": null, "base_currency_amount": 100.0, "creater_id": 3, "updater_id": 3, "description": "Sample description", "lookup_information": {} }, { "id": 2, "name": "Sample Product 2", "category": null, "custom_field": { "cf_quantity": null, "cf_rating": null }, "product_code": null, "sku_number": null, "parent_product": null, "territory_id": null, "valid_till": null, "is_active": true, "owner_id": 3, "is_deleted": false, "created_at": "2021-10-08T05:21:17-08:00", "updated_at": "2021-10-10T20:22:04-08:00", "pricing_type": 1, "product_pricings": [], "avatar": null, "base_currency_amount": 1000.0, "creater_id": 3, "updater_id": 3, "description": "Sample description", "lookup_information": {} } ] } ``` -------------------------------- ### Add Prices to a Product Source: https://developers.freshworks.com/crm/api/index Adds pricing information to a product, including currency, unit price, and setup fees for subscription-based pricing. This PUT request is used when initially adding products or updating pricing. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X PUT "https://domain.myfreshworks.com/crm/sales/api/cpq/products/1?include=product_pricings" ``` -------------------------------- ### Add Products to Deal Source: https://developers.freshworks.com/crm/api/index This API endpoint allows you to add products to a specific deal. You can include details such as product ID, quantity, discount, billing cycle, unit price, and setup fee. A maximum of 100 products can be added per deal. ```json { "deal": { "products": [ { "id": 1, "quantity": 1, "discount": 0, "billing_cycle": 6, "unit_price": 2000, "setup_fee": 200 }, { "id": 2, "quantity": 2, "discount": 10 } ] } } ``` ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"deal":{"products":[{"id":1,"quantity":1,"discount":0,"billing_cycle":6,"unit_price":2000,"setup_fee":200},{"id":2,"quantity":2,"discount":10}]}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/deals/1?include=products" ``` -------------------------------- ### List Filtered Appointments using cURL Source: https://developers.freshworks.com/crm/api/index This example demonstrates how to list appointments with filters and include additional details using cURL. It shows how to filter by 'open' status and include 'creater' information in the response. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET https://domain.myfreshworks.com/crm/sales/api/appointments?filter=open&include=creater ``` -------------------------------- ### Add Product Prices (Subscription) Source: https://developers.freshworks.com/crm/api/index This code snippet shows how to add prices for a product with a subscription pricing type using the Freshworks CRM API. It allows specifying billing cycles and setup fees for different currencies. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"product":{"pricing_type":2,"product_pricings":[{"currency_code":"USD","unit_price":100,"setup_fee":10,"billing_cycle":6,"billing_type":1},{"currency_code":"INR","unit_price":7400,"setup_fee":740,"billing_cycle":6,"billing_type":1}]}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/cpq/products/1?include=product_pricings" ``` -------------------------------- ### Get Deal Information Source: https://developers.freshworks.com/crm/api/index This snippet shows a sample JSON response when retrieving information about a specific deal. It includes details like the deal's ID, name, amount, stage, and associated links to other resources like conversations and tasks. ```json { "deal": { "id": 1, "name": "Gold plan (sample)", "amount": "0.0", "base_currency_amount": "0.0", "expected_close": "2021-10-01", "closed_date": null, "stage_updated_time": "2021-09-23T18:37:56+05:00", "custom_field": {}, "probability": 100, "updated_at": "2021-10-08T21:38:44+05:00", "created_at": "2021-09-19T18:37:52+05:00", "deal_pipeline_id": 1, "deal_stage_id": 1, "age": 19, "links": { "conversations": "/deals/1/conversations/all?include=email_conversation_recipients%2Ctargetable%2Cphone_number%2Cphone_caller%2Cnote%2Cuser&per_page=3", "document_associations": "/deals/1/document_associations", "notes": "/deals/1/notes?include=creater", "tasks": "/deals/1/tasks?include=creater,owner,updater,targetable,users,task_type", "appointments": "/deals/1/appointments?include=creater,owner,updater,targetable,appointment_attendees,conference,note" }, "recent_note": null, "completed_sales_sequences": null, "active_sales_sequences": null, "web_form_id": null, "upcoming_activities_time": null, "collaboration": {}, "last_assigned_at": "2021-09-19T18:37:52+05:00", "tags": [], "last_contacted_sales_activity_mode": null, "last_contacted_via_sales_activity": null, "expected_deal_value": "0.0", "is_deleted": false, "team_user_ids": null, "avatar": null, "fc_widget_collaboration": { "convo_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJDb252b0lkIjoiMSIsInR5cGUiOiJkZWFsIn0.Y15lvAElMjqJjrbMObkd0N66cVY919Fye-GnMM6OUSQ", "auth_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJVc2VyVVVJRCI6IjM2NTA4OTQ5OTYyNjUwNDExMyJ9.TrF3ZcI-Bd8UyqrjJaplsXkxGszubc-1wUDJDg-3HEY", "encoded_jwt_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwcm9kdWN0IjoiZnJlc2hzYWxlcyIsImNvbnRleHRfaWQiOiIxIiwiY29udGV4dF90eXBlIjoiRGVhbCIsInByb2R1Y3RfYWNjb3VudF9pZCI6IjE2MzI0OTAzNzAiLCJwcm9kdWN0X2FjY291bnRfZG9tYWluIjoibXlzcWwuZnJlc2hzYWxlcy1kZXYuY29tIiwidXNlcl9lbWFpbCI6ImpvdGhpc3dhcmFuLnNlbGxhbXV0aHUxQGZyZXNod29ya3MuY29tIiwiaXNfc2VydmVyIjp0cnVlLCJleHAiOjE2MzM3MTEyNDR9.Ju0dhgXiP2BNnaMwpHn7x6gCTBsyfXHriG8FY_uu2To" }, "forecast_category": 2, "rotten_days": null, "has_products": false, "products": [] } } ``` -------------------------------- ### View a Task with Embedded Users and Targetable Data using cURL Source: https://developers.freshworks.com/crm/api/index This example shows how to retrieve the details of a specific task using its ID via a GET request with cURL. It also demonstrates how to embed additional information such as 'users' and 'targetable' data in the response by using the 'include' query parameter. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/tasks/1?include=users,targetable" ``` -------------------------------- ### Get Related Products of CPQ Document Source: https://developers.freshworks.com/crm/api/index Retrieves a list of all products associated with a specific CPQ document. This is a GET request to the related_products endpoint for a given document ID. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/cpq/cpq_documents/1/related_products" ``` -------------------------------- ### View Deal Details with Owner Information Source: https://developers.freshworks.com/crm/api/index API call to retrieve the details of a specific deal, including embedded owner information. This uses the GET method with an 'include' parameter to specify the desired related data. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/deals/1?include=owner" ``` -------------------------------- ### Fetch All Marketing Lists using Curl Source: https://developers.freshworks.com/crm/api/index This code snippet shows how to retrieve all marketing lists created in the Freshworks CRM using the API via cURL. It makes a GET request to the /api/lists endpoint. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/lists" ``` -------------------------------- ### Edit Products of a Document (Curl) Source: https://developers.freshworks.com/crm/api/index This example illustrates how to edit products within a Freshworks CRM document using the API. Sending a single product in the request payload will replace all existing products with the provided one. The code demonstrates a PUT request to the `/api/cpq/cpq_documents/[id]?include=products` endpoint with updated product information. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"cpq_document":{"products":[{"id":1,"quantity":2,"discount":10,"billing_cycle":6,"unit_price":4000,"setup_fee":400}]}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/cpq/cpq_documents/1?include=products" ``` -------------------------------- ### Update Products in a Document (Curl) Source: https://developers.freshworks.com/crm/api/index This code snippet demonstrates how to update products associated with a specific document using the Freshworks CRM API. It shows a PUT request with a JSON payload containing product details like ID, quantity, discount, billing cycle, unit price, and setup fee. The `include=products` parameter ensures product information is returned in the response. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"cpq_document":{"products":[{"id":1,"quantity":1,"discount":0,"billing_cycle":6,"unit_price":2000,"setup_fee":200},{"id":2,"quantity":2,"discount":10}]}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/cpq/cpq_documents/1?include=products" ``` -------------------------------- ### Create Contact Associated with Multiple Accounts Source: https://developers.freshworks.com/crm/api/index This example shows how to create a contact and associate it with multiple sales accounts. You can specify which account is primary. The API call includes contact details and a list of sales accounts with their IDs and primary status. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"contact":{"first_name":"James", "last_name":"Sampleton (sample)", "mobile_number":"1-926-555-9503", "custom_field": {"cf_is_active": true}, "sales_accounts":[{"id" : 1, "is_primary" : true}, {"id" : 2, "is_primary": false}] }}' -X POST "https://domain.myfreshworks.com/crm/sales/api/contacts" ``` -------------------------------- ### Create Product Source: https://developers.freshworks.com/crm/api/index This API allows you to create a new product in the Freshworks CRM. Key parameters include product name, description, category, and whether it is active. You can also specify product code, SKU number, validity, and assign an owner. ```bash curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"product":{"name":"Sample Product","description":"This is a sample product","category":"Software","is_active":true,"parent_product":1,"product_code":"sample_product","sku_number":"sample_sku","valid_till":"Sat Nov 06 2021 00:00:00 GMT+0500","owner_id":3}}' -X POST "https://domain.myfreshworks.com/crm/sales/api/cpq/products" ``` -------------------------------- ### Get Custom Module Details Source: https://developers.freshworks.com/crm/api/index Retrieves the customization details for a specific custom module using its ID. This involves a GET request to the module_customizations endpoint. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/settings/module_customizations/3000000034" ``` -------------------------------- ### Create a Product using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Create a new product in the Freshworks CRM's product catalog. This endpoint requires product details as input. ```REST POST /api/cpq/products ``` -------------------------------- ### Get CPQ Document Details Source: https://developers.freshworks.com/crm/api/index Retrieves the details of a specific CPQ document, including its associated products and custom fields. This is a GET request to the CPQ documents endpoint. ```json { "cpq_document": { "id": 1, "deal_id": 1, "contact_id": 1, "sales_account_id": 1, "document_type": "Quote", "stage": "Sent to customer", "valid_till": "2021-11-17T15:00:00-09:00", "shipping_address": "604-5854 Beckford St.", "shipping_city": "Glendale", "shipping_state": "Arizona", "shipping_zipcode": "100652", "shipping_country": "USA", "billing_address": "1552 camp st", "billing_city": "San Diego", "billing_state": "CA", "billing_zipcode": "92093", "billing_country": "USA", "owner_id": 1, "amount": 8316.0, "currency_code": "USD", "base_currency_amount": 8316.0, "creater_id": 3, "updater_id": 3, "custom_field": { "cf_number_field": null, "cf_rating": null }, "created_at": "2021-10-24T21:17:08-08:00", "updated_at": "2022-01-03T22:12:12-09:00", "is_deleted": false, "document_number": "DOC-1", "territory_id": 1, "is_deal_primary": false, "products": [ { "id": 1, "product_id": 1, "cpq_document_id": 1, "currency_code": "USD", "billing_cycle": 6, "billing_type": 1, "unit_price": 4000.0, "setup_fee": 400.0, "quantity": 2, "discount": 10.0, "item_id": "1-1", "name": "Sample Product", "pricing_type": 2, "avatar": null, "owner_id": 3 } ], "display_name": "Sample Document", "email_template_id": null, "cpq_document_template_name": "Sample Template", "has_products": true } } ``` -------------------------------- ### Create Deal and Associate with New Account Source: https://developers.freshworks.com/crm/api/index API call to create a new deal and simultaneously associate it with a new sales account. The request includes deal information and the details for the new account. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"deal":{"name":"Sample deal", "amount":23456, "sales_account":{"name":"Sample Account"}, "custom_field":{"cf_number_of_agents":45} }}' -X POST "https://domain.myfreshworks.com/crm/sales/api/deals" ``` -------------------------------- ### Get List of All Fields in Custom Module Source: https://developers.freshworks.com/crm/api/index This API retrieves a list of all fields present in your custom module. The request is a simple GET request to the specified endpoint, requiring an authorization token and content type header. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/settings/cm_property/forms" ``` -------------------------------- ### Create a Deal using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Create a new deal in Freshworks CRM. This endpoint requires deal details as input. ```REST POST /api/deals ``` -------------------------------- ### Get Contacts Source: https://developers.freshworks.com/crm/api/index Retrieves a list of contacts from the Freshworks CRM. The response includes contact details and metadata about the pagination. ```json { "contacts": [ { "id": 1, "first_name": "James", "last_name": "Sampleton", "display_name": "James Sampleton", "avatar": null, "job_title": null, "city": null, "state": null, "zipcode": null, "country": null, "email": "jamessampleton@gmail.com", "emails": [ { "id": 1, "value": "jamessampleton@gmail.com", "is_primary": true, "label": null, "_destroy": false } ], "time_zone": null, "work_number": null, "mobile_number": null, "address": null, "last_seen": null, "lead_score": 0, "last_contacted": null, "open_deals_amount": "0.0", "won_deals_amount": "0.0", "last_contacted_sales_activity_mode": null, "custom_field": {}, "created_at": "2022-07-27T12:02:15Z", "updated_at": "2022-08-08T05:33:53Z", "keyword": null, "medium": null, "last_contacted_mode": null, "recent_note": null, "won_deals_count": 0, "last_contacted_via_sales_activity": null, "completed_sales_sequences": null, "active_sales_sequences": null, "web_form_ids": null, "open_deals_count": 0, "last_assigned_at": "2022-07-27T12:02:14Z", "tags": [], "facebook": null, "twitter": null, "linkedin": null, "is_deleted": false, "team_user_ids": null, "external_id": null, "work_email": null, "subscription_status": 1, "subscription_types": "2;3;4;5;1", "customer_fit": 0, "record_type_id": "1000000074", "whatsapp_subscription_status": 2, "sms_subscription_status": 2, "last_seen_chat": null, "first_seen_chat": null, "locale": null, "total_sessions": null, "phone_numbers": [] }, { "id": 2, "first_name": "Jane", "last_name": "Sampleton (sample)", "display_name": "Jane Sampleton (sample)", "avatar": null, "job_title": null, "city": null, "state": null, "zipcode": null, "country": null, "email": "janesampleton@gmail.com", "emails": [ { "id": 2, "value": "janesampleton@gmail.com", "is_primary": true, "label": "Other", "_destroy": false } ], "time_zone": null, "work_number": null, "mobile_number": "1234567890", "address": null, "last_seen": null, "lead_score": 0, "last_contacted": null, "open_deals_amount": "0.0", "won_deals_amount": "0.0", "last_contacted_sales_activity_mode": null, "custom_field": {}, "created_at": "2022-08-01T07:47:42Z", "updated_at": "2022-08-08T08:45:33Z", "keyword": null, "medium": null, "last_contacted_mode": null, "recent_note": null, "won_deals_count": 0, "last_contacted_via_sales_activity": null, "completed_sales_sequences": null, "active_sales_sequences": null, "web_form_ids": null, "open_deals_count": 0, "last_assigned_at": "2022-08-01T07:47:41Z", "tags": [], "facebook": null, "twitter": null, "linkedin": null, "is_deleted": false, "team_user_ids": null, "external_id": null, "work_email": null, "subscription_status": 1, "subscription_types": "2;3;4;5;1", "customer_fit": 0, "record_type_id": "1000000074", "whatsapp_subscription_status": 2, "sms_subscription_status": 2, "last_seen_chat": null, "first_seen_chat": null, "locale": null, "total_sessions": null, "phone_numbers": [] } ], "meta": { "total_pages": 1, "total": 2, "avatar_data": { "Contact": { "1": null, "2": null } } } } ``` -------------------------------- ### View Product Details with Pricing Source: https://developers.freshworks.com/crm/api/index Retrieve detailed information about a specific product, including its pricing structure. The 'include' parameter can be used to embed related data like 'product_pricings'. Requires an authorization token and product ID. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/cpq/products/1?include=product_pricings" ``` -------------------------------- ### Fetch Freshworks CRM Deal Products Source: https://developers.freshworks.com/crm/api/index Retrieves details for all existing deal products in the Freshsales portal. The response includes the product's ID and name. ```json GET /api/selector/deal_products ``` -------------------------------- ### Create a Note for a Deal using cURL Source: https://developers.freshworks.com/crm/api/index This snippet demonstrates how to create a new note associated with a deal using a cURL command. It includes the necessary authorization headers, content type, and a JSON payload specifying the note's description, targetable type, and targetable ID. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"note":{"description":"Create Sample note for a deal", "targetable_type":"Deal", "targetable_id":1}}' -X POST https://domain.myfreshworks.com/crm/sales/api/notes ``` -------------------------------- ### View Contact Details with Sales Accounts Source: https://developers.freshworks.com/crm/api/index This API GET request retrieves the details of a specific contact, including associated sales accounts. The `include=sales_accounts` parameter embeds the sales account information in the response. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/contacts/1?include=sales_accounts" ``` -------------------------------- ### Update another Note for a Contact using cURL Source: https://developers.freshworks.com/crm/api/index This snippet demonstrates updating a different note for a contact using cURL. It's similar to the previous example but targets a different note ID in the API request. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"note":{"description":"Sample note for contact update", "targetable_type":"Contact", "targetable_id":1}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/notes/2" ``` -------------------------------- ### Bulk-restore Products Source: https://developers.freshworks.com/crm/api/index Restores multiple deleted products in bulk by providing an array of their IDs. This PUT request initiates the restoration process and provides a notification upon completion. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"selected_ids":[1,2]}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/cpq/products/products_bulk_restore" ``` -------------------------------- ### Mark Task as Done using Curl Source: https://developers.freshworks.com/crm/api/index This example shows how to mark a task as done in Freshworks CRM using a PUT request with Curl. It requires authorization, content type, and a JSON payload specifying the task status. ```Curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"task": {"status" :1}' -X PUT https://domain.myfreshworks.com/crm/sales/api/tasks/1 ``` -------------------------------- ### Create an Account using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Create a new sales account in Freshworks CRM. This endpoint requires account details as input. ```REST POST /api/sales_accounts ``` -------------------------------- ### Create Deal and Associate with Contacts Source: https://developers.freshworks.com/crm/api/index API call to create a new deal and associate it with existing contacts. The request includes deal details and a list of contact IDs to be added. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"deal":{"name":"Sample deal", "amount":23456, "sales_account":{"name":"Sample Account"}, "custom_field":{"cf_number_of_agents":45}, "contacts_added_list":[1,2] }}' -X POST "https://domain.myfreshworks.com/crm/sales/api/deals" ``` -------------------------------- ### Get Job Status by ID (cURL) Source: https://developers.freshworks.com/crm/api/index Retrieves the status of a bulk upsert job using its ID. Requires an Authorization header with a token and a Content-Type header. The response includes job status, type, and detailed data on succeeded/failed records. ```cURL curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/job_statuses/[id]" ``` -------------------------------- ### Fetch Freshworks CRM Currencies Source: https://developers.freshworks.com/crm/api/index Retrieves details for all existing currency configurations in the Freshsales portal. The response includes the currency's ID, currency code, and other relevant details. ```json GET /api/selector/currencies ``` -------------------------------- ### Update a Note for an Account using cURL Source: https://developers.freshworks.com/crm/api/index This example illustrates how to update a note associated with a sales account using a cURL command. It includes the authorization header, content type, and a JSON payload with the updated note description and targetable information. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"note":{"description":"Update the Sample note for an account", "targetable_type":"SalesAccount", "targetable_id":1}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/notes/3" ``` -------------------------------- ### Create Manual Call Log for Sales Account Source: https://developers.freshworks.com/crm/api/index This API allows you to create a manual call log and associate it with an existing sales account. The `call_direction` parameter is mandatory. You can optionally include a note, and if a note is provided, its `description` field is also mandatory. ```bash curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d ' {"phone_call": {"call_direction": true, "targetable_type": "salesAccount", "targetable": { "id": "82", "name": "test", "phone": "5304915427" }, "note": { "description": "Sample contact notes "}}}' -X POST https://domain.myfreshworks.com/crm/sales/api/phone_calls ``` -------------------------------- ### Fetch Freshworks CRM Deal Reasons Source: https://developers.freshworks.com/crm/api/index Retrieves details for all existing deal reasons in the Freshsales portal. The response includes the deal reason's ID and name. ```json GET /api/selector/deal_reasons ``` -------------------------------- ### Freshworks CRM API: Lookup Search by Email (Curl) Source: https://developers.freshworks.com/crm/api/index This cURL command shows how to use the lookup API in Freshworks CRM to search for contacts by their email address. It includes the necessary authorization, content type, and query parameters for the GET request. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET https://domain.myfreshworks.com/crm/sales/api/lookup?q=janesampleton@gmail.com&f=email&entities=contact ``` -------------------------------- ### List All Deal Fields using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Retrieve a list of all available fields for deals. This helps in understanding the data structure for deals. ```REST GET /api/settings/deals/fields ``` -------------------------------- ### Update Deal Products via API Source: https://developers.freshworks.com/crm/api/index This code snippet demonstrates how to update the products associated with a deal using a PUT request to the Freshworks CRM API. It shows how to specify product details like ID, quantity, discount, billing cycle, and unit price. Sending only one product will replace all existing products. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"deal":{"products":[{"id":1,"quantity":2,"discount":100,"billing_cycle":6,"unit_price":4000,"setup_fee":400}]}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/deals/1?include=products" ``` -------------------------------- ### Update a Note for a Contact using cURL Source: https://developers.freshworks.com/crm/api/index This code example shows how to update an existing note for a contact using a cURL command. It specifies the note ID in the URL and includes the authorization header, content type, and a JSON payload with the updated note description. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"note":{"description":"Sample note for contact update", "targetable_type":"Contact", "targetable_id":1}}' -X PUT "https://domain.myfreshworks.com/crm/sales/api/notes/1" ``` -------------------------------- ### Fetch Freshworks CRM Lead Sources Source: https://developers.freshworks.com/crm/api/index Retrieves details for all existing lead sources in the Freshsales portal. The response includes the lead source's ID and name. ```json GET /api/selector/lead_sources ``` -------------------------------- ### Fetch Freshworks CRM Deal Pipelines Source: https://developers.freshworks.com/crm/api/index Retrieves details for all existing deal pipelines in the Freshsales portal. The response includes the pipeline's ID and name. ```json GET /api/selector/deal_pipelines ``` -------------------------------- ### Fetch Contacts from Marketing List using Curl Source: https://developers.freshworks.com/crm/api/index This code snippet illustrates how to fetch all contacts belonging to a specific marketing list using the Freshworks CRM API via cURL. It performs a GET request to the /api/contacts/lists/[id] endpoint, specifying the list ID. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/contacts/lists/1" ``` -------------------------------- ### Clone a Deal with Specific Properties Source: https://developers.freshworks.com/crm/api/index This API allows you to clone an existing deal. By default, all properties are copied. You can specify certain properties for the new deal, similar to the Create A Deal API. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"deal":{"name":"Sample deal", "amount":23456, "sales_account_id":1}}' -X POST 'https://domain.myfreshworks.com/crm/sales/api/deals/1/clone' ``` -------------------------------- ### Add Number Field to Custom Module Source: https://developers.freshworks.com/crm/api/index This code example shows how to add a number field to a custom module via the Freshworks CRM API. It specifies the field's label, type (e.g., 'decimal'), visibility, and locale options, using a cURL command. ```bash curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{ "field": { "hint": "holds sample number field value", "internal_name": "sample_number_field", "label": "sample number field", "type": "decimal", "editable": true, "visible": true, "required": false, "field_options": { "locale": "en-IN" }, "parent_id": "076f9e4e-1618-49f2-bfb0-9c37889ecf92" } }' -X POST "https://domain.myfreshworks.com/crm/sales/api/settings/cm_property/forms/1/fields" ``` -------------------------------- ### View a Product using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Retrieve details of a specific product by providing its unique ID. This is used for fetching individual product information. ```REST GET /api/cpq/products/[id] ``` -------------------------------- ### Create Manual Call Log for New Contact Source: https://developers.freshworks.com/crm/api/index This API enables the creation of a new contact and a manual call log, which is then linked to the newly created contact. Similar to logging for existing contacts, `call_direction` is required, and notes can be included. ```json { "contacts": [{ "partial": true, "id": 1 }], "phone_numbers": [], "phone_callers": [], "notes": [{ "id": 4, "description": "Sample note", "created_at": "2016-09-12T08:23:43Z", "updated_at": "2016-09-12T08:23:43Z", "creater_id": 1, "targetable_id": 1 }], "user": [{ "id": 1, "display_name": "Sample User", "email": "sampleuser@yourcompany.com", "is_active": true }], "targetables": [{ "id": 1, "display_name": "Jane Sampleton (sample)", "email": "janesampleton@gmail.com" }], "phone_calls": { "id": 1, "call_duration": null, "call_direction": true, "recording_duration": null, "status": "incoming", "recording": null, "conversation_time": "2016-09-12T08:23:43Z", "cost": 0, "is_manual": true, "targetable": { "type": "contact", "id": 1 }, "phone_number_id": null, "phone_caller_id": null, "note_id": 4 } } ``` -------------------------------- ### Response for Deleting Products Source: https://developers.freshworks.com/crm/api/index Shows the response after successfully deleting products from a CPQ document. The 'products' array will be empty, and the 'has_products' flag will be false. ```json { "cpq_document": { "id": 1, "deal_id": 1, "contact_id": 1, "sales_account_id": 1, "document_type": "Quote", "stage": "Draft", "valid_till": "2021-10-28T11:00:00-08:00", "shipping_address": "604-5854 Beckford St.", "shipping_city": "Glendale", "shipping_state": "Arizona", "shipping_zipcode": "100652", "shipping_country": "USA", "billing_address": "1552 camp st", "billing_city": "San Diego", "billing_state": "CA", "billing_zipcode": "92093", "billing_country": "USA", "owner_id": 1, "amount": 0.0, "currency_code": "USD", "base_currency_amount": 0.0, "creater_id": 3, "updater_id": 3, "custom_field": { "cf_custom_status": null, "cf_rating": null }, "created_at": "2021-10-24T21:17:08-08:00", "updated_at": "2021-10-26T01:55:23-08:00", "is_deleted": false, "document_number": "DOC-1", "territory_id": 1, "is_deal_primary": false, "products": [], "display_name": "Sample Document", "email_template_id": null, "cpq_document_template_name": "Sample Template", "has_products": false } } ``` -------------------------------- ### Create Appointment using cURL Source: https://developers.freshworks.com/crm/api/index This snippet demonstrates how to create a new appointment using a cURL command. It includes setting authorization headers, content type, and sending appointment details in JSON format, including title, description, dates, time zone, location, and attendees. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"appointment":{"title":"Sample Appointment","description":"This is just a sample Appointment.","from_date":"Mon Jun 20 2016 10:30:00 GMT+0530 (IST)","end_date":"Mon Jun 20 2016 11:30:00 GMT+0530 (IST)","time_zone":"Chennai","location":"Chennai, TN, India","targetable_id":"115765","targetable_type":"Contact", "appointment_attendees_attributes":[{ "attendee_type":"FdMultitenant::User","attendee_id":"223"},{ "attendee_type":"FdMultitenant::User","attendee_id":"222"},{ "attendee_type":"Contact","attendee_id":"115773"}] }}' -X POST https://domain.myfreshworks.com/crm/sales/api/appointments ``` -------------------------------- ### List All Deals using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Fetch a list of all deals, optionally filtered by a view ID. This endpoint retrieves multiple deal records. ```REST GET /api/deals/view/[view_id] ``` -------------------------------- ### List Sales Activities Source: https://developers.freshworks.com/crm/api/index API to list all sales activities. Supports pagination parameters like 'page' and 'per_page' for controlling the number of results returned. ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET https://domain.myfreshworks.com/crm/sales/api/sales_activities ``` ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/sales_activities?page=1" ``` ```curl curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -X GET "https://domain.myfreshworks.com/crm/sales/api/sales_activities?per_page=10&page=1" ``` -------------------------------- ### Add Products to Document using Freshworks CRM API Source: https://developers.freshworks.com/crm/api/index Allows adding products to a specific document in Freshworks CRM. A maximum of 100 products can be added per request. The API endpoint is api/cpq/cpq_documents/[id]?include=products and uses the PUT method. ```curl api/cpq/cpq_documents/[id]?include=products ```