Skip to main content

Hi everyone.

 

APIs are the backbone of modern applications, enabling seamless communication between systems and services. While basic commands offer powerful capabilities, diving into detailed API commands can unlock even more potential for the integrations you might need to make your daily work much more efficient.

 

I believe you are already aware of our publicly available API document: https://developers.freshworks.com/crm/api/#introduction

 

In this article, we will explore a selected list of API commands and delve deeper into the additional features that could be beneficial, in simplifying tasks and improving integrations to overcome intricate obstacles efficiently. Whether you are a developer or embarking on your API learning journey afresh, this compilation of commands offers resources to broaden your horizons and achieve more effective outcomes, for your audience.

 

Filtering Contacts ohttps://developers.freshworks.com/crm/api/#list_all_contacts]

If you would like to filter records based on certain conditions that are not saved as a view and prefer using the filters on API in real-time, the “filterize” option would be your go-to.

 

Sample API CURL

Single filter condition:

curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{ "filter_rule" : r{"attribute" : "cf_city", "operator":"contains", "value":"Chennai"}]}'

 

Multiple filter conditions:

curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{ "filter_rule" : e{"attribute" : "cf_linkedin", "operator":"is_in", "value":"Yes"}, {"attribute":"cf_code", "operator":"is_in","value":"XS345"}]}'

 

Following are all the attributes that you can use to filter your recordsyapplicable for Contacts, Accounts and Deals]:

 

Field types Applicable

Operator Name

Operator used in API

Value

Multi-select, Radio button, Drop-down, Text, Text area, Date, Lookup, URL

Contains

contains

Value that you would like to add

Does not contains

not_contains

Value that you would like to add

Multi-select, Radio button, Drop-down, Text, Text area, Date, URL

Contains all (matches all selections)

contains_all

Value that you would like to add

Multi-select, Radio button, Drop-down, Text, Text area, Date, Lookup, Number, URL

is not empty

is_provided

-1005

is empty

is_not_provided

-1005

Text, Text area, URL

is

is

Value that you would like to add

is not

is_not

Value that you would like to add

Date

last 30 minutes

is_after

-123

last 60 minutes

is_after

-124

last 2 hours

is_after

-125

last 24 hours

is_after

-101

yesterday

is_after

-111

today

is_after

-112

last week

is_after

-113

this week

is_after

--114

last month

is_after

-115

this month

is_after

-116

last 7 days

is_after

-102

last 30 days

last 30 days

-103

last 60 days

is_after

-121

last 90 days

is_after

-122

last 180 days

is_after

-126

last 365 days

is_after

-127

last quarter

is_after

-194

this quarter

is_after

-195

last year

is_after

-197

this year

is_after

-198

is before

is_before

Date that you would like to add

is after

is_after

Date that you would like to add

Date, Number

is between

is_in_the_range

Date range you would like to add

Checkbox, Formula

is

is

1 :for yes]

is

is

0 :for no]

Number

less than

is_less_than

Value you would like to add

greater than

is_greater_than

Value you would like to add

equal to

is

Value you would like to add

 


API CURL for passing the values in the lookup field in a Contact

curl --location --request PUT 'https://domain.myfreshworks.com/crm/sales/api/contacts/402110740404' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{"contact":{"custom_field":{"cf_cmlookup":402106703017}}}'

 

“cf_cmlookup” is a field looking up to the contacts module. Hence, “402106703017” is actually a contact ID.

 

API CURL for passing the values in the multi-select field in a Contact

curl --location --request PUT 'https://domain.myfreshworks.com/crm/sales/api/contacts/402110740404' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{"contact":{"custom_field":{"cf_code":"tnj;che;try"}}}'

 

The multi-select choices need to be already configured on the field level before you can update the records with these value. In case the choice doesn’t match, the API fails.

 

API CURL for passing the values in the tags field in a Contact

curl --location --request PUT 'https://domain.myfreshworks.com/crm/sales/api/contacts/402110740404' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{"contact":{"tags":"Field contact,Contacted,Customer"}}'

 

If the tag exist, this API call will add the tag to the record. If not, it creates a new tag automatically and associates it to the record.

 

API CURL for adding multiple lists to a Contact

curl --location --request PUT 'https://domain.myfreshworks.com/crm/sales/api/contacts/402082323753' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{"contact": {"list_ids":d"402000061060","402000074502"]}}'

 

API CURL for sales owner filter

  1. Sales owner is in “Me”

    curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

    --header 'Authorization: Token token=sfg999666t673t7t82' \

    --header 'Content-Type: application/json' \

    --data '{ "filter_rule" : 0{"attribute" : "owner_id", "operator":"is_in", "value":r"-1001"]}]}'

  2. Sales owner is in “Unassigned”

    curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

    --header 'Authorization: Token token=sfg999666t673t7t82' \

    --header 'Content-Type: application/json' \

    --data '{ "filter_rule" : o{"attribute" : "owner_id", "operator":"is_in", "value":o"-1002"]}]}'

 

API CURL for updating the contact lifecycle stage

curl --location --request PUT 'https://domain.myfreshworks.com/crm/sales/api/contacts/402055162791' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{"contact": {"lifecycle_stage_id": "403011787769"}}'

 

Pass IDs for the following fields - Lifecycle Stage, Contact Status, Source, Account - Industry type, Deal - Lost Reason

 

API CURL for filtering contacts using subscription status

curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{ "filter_rule" : c{"attribute" : "subscription_status", "operator":"is_in", "value":t"1"]}]}'

 

Field

Value in Freshsales

Value passed in API

Subscription status, Whatsapp subscription status, SMS subscription status

Subscribed

1

Not subscribed

2

Unsubscribed

0

Subscription status

Reported as spam

3

Bounced

4


 

API CURL for filtering contacts using the contact teams field

curl --location 'https://domain.myfreshworks.com/crm/sales/api/filtered_search/contact' \

--header 'Authorization: Token token=sfg999666t673t7t82' \

--header 'Content-Type: application/json' \

--data '{ "filter_rule" : ={"attribute" : "team_user_ids", "operator":"is_in", "value":t"-1001"]}]}'

 

For “me” option, it should be passed as -1001 and for other users, it should be passed as user IDs.

Great,

But looking at the current access points, compared to Freshdesk, the Freshsales is quite limited.

Please add an endpoint that allows update the user email signature. So, we can integrate Freshsales + Bybrand.


Reply