I am trying to Put data to this endpoint: https://--Details removed by moderator--.freshdesk.com/api/v2/companies/
I am using the Freshdesk API request (Beta) but could also use the Webhooks by Zapier raw function.
I have successfully set up the component, with a JSON body that corresponds to tha API fields with static values, and it works. Here is the example:
{
"name": "At Martins",
"description": "Is the test working?",
"note": "Where does notes go?",
"account_tier":"Mid" ,
"industry": "Aviation",
"renewal_date": "2025-02-26",
"domains": [
"boobs.ai",
"ff.com"
],
"custom_fields": {
"account_owner": "Jon",
"account_record_id": "123",
"planhat_id": "123",
"contract_type": "Standard",
"partner": "Advania Iceland",
"region": "Nordics",
"country": "Australia"
}
}
My problem is that not all of these variables will always have an value, as they are not mandatory fields. However, when the api receives an empty/Null value, it throws an error.
So my question is, how do I set up a logic or dynamically change what variables is in the API request Body dependent on weather there is a value in the variable or not within zapier? Or how can I somehow otherwise avoid this error?