simple-salesforce 创建任务或创建呼叫日志。蟒蛇API

问题描述 投票:0回答:1

使用 python api simple-salesforce,https://pypi.org/project/simple-salesforce/

我想创建任务或通话记录。 有可能吗?

我看到了一次失败的尝试在这里

我试过了

from simple_salesforce import Salesforce
sf = Salesforce(instance_url=sf_db.instance_url, session_id=sf_db.access_token)
# "sf" works on getting and creating contacts.

call_log_data = {
            "WhoId": contact_id,  # ID of the contact
            "Subject": "My subject",  # Subject of the call log
            "ActivityDateTime": "2024-04-08",  # Date and time of the call
            "Description": "anything",  # Notes about the call
        }

    result = sf.Task.create("Task", call_log_data)

task.create

上出现错误
[{\'message\': "Json Deserialization failed on token \'null\' and has left off in the middle of parsing a row. Will go to end of row to begin parsing the next row", \'errorCode\': \'INVALID_FIELD\'}]'}

下面只是 salesforce 控制台的 ui 图像,我想在其中执行与 API 中相同的操作。

python salesforce simple-salesforce
1个回答
0
投票

原来是这个。必须删除第一个参数。

result = sf.Task.create(call_log_data)

这会创建一个任务。但我想创建一个通话记录。有什么想法吗?

© www.soinside.com 2019 - 2024. All rights reserved.