Trouble using api to create a sales activity using a default activity id

Hi,
When I create a sales Activity using any activity id of a default activity (non-custom) I get the following error:

{
"errors": {
    "code": 400,
    "message": [
        "This sales activity type no longer exists."
    ]
}

}

Has anyone else experienced this? Or do you have a recommendation about how I should proceed?

Here is an example of what I am posting:
{
“sales_activity”:{
“sales_activity_type_id”: 13000188112,
“notes”: “a note”,
“title”: “A title”,
“targetable_id”: 13005376787,
“targetable_type”: “Contact”,
“start_date”: “2020-07-04T00:46:22”,
“end_date”: “2020-07-04T00:56:22”,
“owner_id”: 13000036274
}
}

Hi @kmuenze,

May I know from when have you started experiencing this issue?

I started to experience it today but today is also the first day I am using the api.
I could not find any other documentation regarding the error or the use case so I figured I would ask the community.

Please try to see the available sales activity configuration for your provided "targetable_type" to find out available configuration in the current account.

My sample GET /api/selector/sales_activity_types

I saw the same error, when Contact activity type didn’t exist in the first place.

{
    "sales_activity_types": [
        {
            "partial": true,
            "id": 9000160067,
            "name": "Talk on ground",
            "internal_name": "followup",
            "show_in_conversation": true,
            "position": 1,
            "is_default": false,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000016635,
            "name": "Chat",
            "internal_name": "chat",
            "show_in_conversation": true,
            "position": 2,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000016636,
            "name": "Phone",
            "internal_name": "phone",
            "show_in_conversation": true,
            "position": 3,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000016637,
            "name": "Appointment",
            "internal_name": "appointment",
            "show_in_conversation": true,
            "position": 4,
            "is_default": true,
            "is_checkedin": true
        },
        {
            "partial": true,
            "id": 9000016638,
            "name": "Task",
            "internal_name": "task",
            "show_in_conversation": true,
            "position": 5,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000016639,
            "name": "Email",
            "internal_name": "email",
            "show_in_conversation": true,
            "position": 6,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000016640,
            "name": "SMS",
            "internal_name": "sms",
            "show_in_conversation": true,
            "position": 7,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 9000140560,
            "name": "Reminder",
            "internal_name": "reminder",
            "show_in_conversation": false,
            "position": 8,
            "is_default": true,
            "is_checkedin": false
        }
    ]
}

The result from GET https://kixie.freshsales.io/api/selector/sales_activity_types

Aren’t all of these available to each Targetable_Type? If not, is there a way to see which ones are available per targetable_type? And how do we configure them to be available?

shows
    {
    "sales_activity_types": [
        {
            "partial": true,
            "id": 13000202484,
            "name": "Call",
            "internal_name": "cphone",
            "show_in_conversation": true,
            "position": 1,
            "is_default": false,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188111,
            "name": "Chat",
            "internal_name": "chat",
            "show_in_conversation": true,
            "position": 4,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188112,
            "name": "Phone",
            "internal_name": "phone",
            "show_in_conversation": true,
            "position": 5,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188113,
            "name": "Appointment",
            "internal_name": "appointment",
            "show_in_conversation": true,
            "position": 6,
            "is_default": true,
            "is_checkedin": true
        },
        {
            "partial": true,
            "id": 13000188114,
            "name": "Task",
            "internal_name": "task",
            "show_in_conversation": true,
            "position": 7,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188115,
            "name": "Email",
            "internal_name": "email",
            "show_in_conversation": true,
            "position": 8,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188116,
            "name": "SMS",
            "internal_name": "sms",
            "show_in_conversation": true,
            "position": 9,
            "is_default": true,
            "is_checkedin": false
        },
        {
            "partial": true,
            "id": 13000188117,
            "name": "Reminder",
            "internal_name": "reminder",
            "show_in_conversation": false,
            "position": 10,
            "is_default": true,
            "is_checkedin": false
        }
    ]
}

Hi @kmuenze,

I found a article on how agents can configure sales activity types - https://support.freshsales.io/support/solutions/articles/230199-how-to-configure-different-sales-activities-in-freshsales-

In case you are trying to create a sales activity, programatically - https://www.freshsales.io/api/#create_sales_activity

Here’s an example curl command,

curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"sales_activity":{"title":"ticket","notes":"sample","targetable_id":"1","targetable_type":"Contact","start_date":"2017-12-04T17:00:00+05:30","end_date":"2017-12-04T17:30:00+05:30","owner_id":"1", "sales_activity_type_id":"2", "sales_activity_outcome_id":"1"}}' -X POST https://domain.freshsales.io/api/sales_activities

Hopefully, the resources can help you make some progress. Please feel free to ask if you need more help.

I think the issue is you cannot add an activitytype of call as a sales activity directly.

I think sales activity type of call is by default available. From you shared payload,

It’s ID is 13000202484

So when you make post request to create this sales acitivity, do try to add this obtained id (from your configuration), to have new Sales activity created.

This topic was automatically closed after 13 days. New replies are no longer allowed.