Freshwork crm phone_calls api is throwing 422 response for a particular req body

Hi,
I just found that phone call api endpoint api/cti_phone_calls is not working for FCRM from past few days for a particular req body. It works fine for Freshsales for the same request body and it used to work for FCRM few days back.

This has impacted FCRM integration. Below are api request details

curl --location --request POST 'https://knowlaritycommunicationspvtltd.myfreshworks.com/crm/sales/api/cti_phone_calls' \
--header 'Authorization: Token token=mytoken' \
--header 'Cache-Control: no-cache' \
--header 'content-type: multipart/form-data;' \
--form 'phone_call="{\"call_direction\":true,\"targetable_type\":\"contact\",\"targetable\":{\"last_name\":\"Knowlarity_Authentication_Test\",\"mobile_number\":\"+910000000001\"},\"note\":{\"description\":\"Authentication ticket from knowlarity\"}}"'

error response

{
    "error_code": 422
}

curl --location --request POST 'https://knowlaritycommunication.freshsales.io/api/cti_phone_calls' \
--header 'Authorization: Token token=mytoken' \
--header 'Cache-Control: no-cache' \
--header 'content-type: multipart/form-data;' \
--form 'phone_call="{\"call_direction\":true,\"targetable_type\":\"contact\",\"targetable\":{\"last_name\":\"Knowlarity_Authentication_Test\",\"mobile_number\":\"+910000000001\"},\"note\":{\"description\":\"Authentication ticket from knowlarity\"}}"'
success response

{
    "contacts": [
        {
            "partial": true,
            "id": 4009822476,
            "first_name": null,
            "last_name": "Knowlarity_Authentication_Test",
            "display_name": "Knowlarity_Authentication_Test",
            "avatar": null,
            "email": null,
            "work_number": null,
            "mobile_number": "+910000000001",
            "job_title": null,
            "department": null,
            "last_seen": null,
            "has_access": true,
            "lead_score": 0,
            "sales_accounts": [],
            "owner_id": null,
            "deal_ids": []
        }
    ],
    "phone_numbers": [],
    "phone_callers": [],
    "notes": [
        {
            "id": 4006652565,
            "description": "Authentication ticket from knowlarity",
            "created_at": "2021-03-17T08:13:33-04:00",
            "updated_at": "2021-03-17T08:13:33-04:00",
            "url": null,
            "duration": null,
            "creater_id": 4000008700,
            "has_access": true,
            "collab_context": {
                "hasSlackViewAccess": false,
                "messageId": ""
            },
            "targetable": {
                "type": "contact",
                "id": 4009822476
            }
        }
    ],
    "user": [
        {
            "id": 4000008700,
            "display_name": "konnect developer",
            "email": "konnect.developer@knowlarity.com",
            "is_active": true,
            "work_number": "+917411162213",
            "mobile_number": "+917411162213"
        }
    ],
    "users": [],
    "outcomes": [],
    "phone_calls": [
        {
            "id": 4003215000,
            "call_duration": null,
            "call_direction": true,
            "recording_duration": null,
            "status": "incoming",
            "recording": null,
            "conversation_time": "2021-03-17T08:13:33-04:00",
            "cost": 0.0,
            "is_manual": true,
            "root_phone_call_id": 4003215000,
            "child_phone_calls": null,
            "outcome_id": null,
            "source": null,
            "freshcaller_id": null,
            "freshcaller_number": null,
            "freshcaller_number_country": null,
            "targetable": {
                "type": "contact",
                "id": 4009822476
            },
            "phone_number_id": null,
            "phone_caller_id": null,
            "note_id": 4006652565,
            "user_id": null
        }
    ],
    "deals": []
}

I tried with following form payload and it worked

phone_call= "{ \"call_direction\": false,\"user_id\":<user_id>, \"targetable_type\": \"Contact\", \"number\":\"9999999999\",\"source\":\"CTICOMPANYNAME\",\"targetable\": { \"id\": \"1500050855\", \"first_name\": \"Jane\", \"last_name\": \"Sampleton (sample)\"}, \"note\": { \"description\": \"Sample note123 for shyam23\"}}"

I am seeing user_id and id under targetable is missing in your form data. Also, user_id should be a proper agent id and id under targetable should be a proper contact id.

@ManiDeepak_Vandrangi user_id is not mandatory parameter. It works without it as well.
so far i observed following

  1. API works fine for Freshsales with same payload but it does not work for FCRM
  2. API works for FCRM if mobile_number does not exist in FCRM. Try passing other mobile_number
    3.mobile_number +910000000004 does not exist in FCRM but still, API throws 422 response code.

I have made SuperReceptionist app omnichannel compatible for both Freshsales and FCRM. Api was working fine few days back but it started throwing 422 error for a particular req body in case of FCRM, While migration of Freshsales to omni app i was informed that there is no change between Freshsales and FCRM except that FCRM does not has lead module and same was verified. Now, how all of a sudden api is behaving differently for Freshsales and FCRM?

@Saif FYI. This has impacted integration with FCRM

1 Like

Hi,

Any update here?

The product team had identified this bug and will fix it shortly.

Hi @ManiDeepak_Vandrangi
Thanks for the update. can you please share tentative timeline for the fix?

Hi @ManiDeepak_Vandrangi
can you please share the tentative timeline for the fix? Freshworks QA won’t be approve SuperReceptionist app to go live in the marketplace without this getting fixed.

Hi @ManiDeepak_Vandrangi
Any update here?