SugarCRM 通话记录 REST API [英] SugarCRM call records REST API

查看:45
本文介绍了SugarCRM 通话记录 REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 REST API 从我的 SugarCRM 帐户获取通话记录,并且我正在使用 Python.我想在那里获取所有与会者,但我得到的只是呼叫分配给的用户.

I am trying to get the call records from my SugarCRM account using the REST API and I am using Python. There I want to obtain all the attendees but all I get is the user to whom the call is assigned.

u'assigned_user_id': u'xxxxxxxx',

u'assigned_user_id': u'xxxxxxxx',

我收到的回复是,

  • {u'created_by_link': {u'id': u'1', u'full_name': u'adminx', u'_acl': {u'fields': {u'last_login':{u'write': u'no', u'create': u'no'}, u'pwd_last_changed': {u'write': u'no', u'create': u'no'}},u'_hash': u'xxxx', u'delete': u'no'}}, u'dri_workflow_task_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

  • {u'created_by_link': {u'id': u'1', u'full_name': u'adminx', u'_acl': {u'fields': {u'last_login': {u'write': u'no', u'create': u'no'}, u'pwd_last_changed': {u'write': u'no', u'create': u'no'}}, u'_hash': u'xxxx', u'delete': u'no'}}, u'dri_workflow_task_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

u'customer_journey_points': 10,

u'customer_journey_points': 10,

u'dri_subworkflow_id': u'',

u'dri_subworkflow_id': u'',

u'recurrence_id': u'',

u'recurrence_id': u'',

u'created_by_name': u'adminx',

u'created_by_name': u'adminx',

u'date_end':u'2018-05-02T09:45:00+00:00',

u'date_end': u'2018-05-02T09:45:00+00:00',

u'dri_subworkflow_template_id': u'',

u'dri_subworkflow_template_id': u'',

u'parent_type': u'Accounts',

u'parent_type': u'Accounts',

u'contact_id': u'xxxx',

u'contact_id': u'xxxx',

u'_acl': {u'fields': {}},

u'_acl': {u'fields': {}},

u'duration_minutes': 30,

u'duration_minutes': 30,

u'tag': [],

u'tag': [],

u'assigned_user_name': u'xxxx',

u'assigned_user_name': u'xxxx',

u'repeat_ordinal': u'',

u'repeat_ordinal': u'',

u'repeat_count':无,

u'repeat_count': None,

u'contact_name': u'xxxx',

u'contact_name': u'xxxx',

u'repeat_interval': 1, u'id': u'xxxx', >- u'parent_name': u'ABC',

u'repeat_interval': 1, u'id': u'xxxx', > - u'parent_name': u'ABC',

你'customer_journey_parent_activity_id':你'',

u'customer_journey_parent_activity_id': u'',

u'date_entered': u'2017-07-17T12:49:23+00:00',

u'date_entered': u'2017-07-17T12:49:23+00:00',

u'outlook_id': u'',

u'outlook_id': u'',

u'team_name': [{u'name_2': u'', u'selected': False, u'primary': True, u'id': u'1', u'name': u'Global'}, {u'name_2': u'', u'selected': False, u'primary': False, u'id': u'West', u'name': u'West'}],

u'team_name': [{u'name_2': u'', u'selected': False, u'primary': True, u'id': u'1', u'name': u'Global'}, {u'name_2': u'', u'selected': False, u'primary': False, u'id': u'West', u'name': u'West'}],

u'contacts': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'xxx', u'id': u'xxx'},

u'contacts': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'xxx', u'id': u'xxx'},

u'dri_workflow_task_template_id': u'',

u'dri_workflow_task_template_id': u'',

u'customer_journey_score':无,

u'customer_journey_score': None,

u'date_start': u'2018-05-02T09:15:00+00:00',

u'date_start': u'2018-05-02T09:15:00+00:00',

u'reminder_checked': u'',

u'reminder_checked': u'',

u'dri_workflow_sort_order':u'1',

u'dri_workflow_sort_order': u'1',

u'created_by': u'1',

u'created_by': u'1',

u'parent_id': u'xxxx',

u'parent_id': u'xxxx',

u'dri_subworkflow_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

u'dri_subworkflow_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

u'dri_subworkflow_name': u'',

u'dri_subworkflow_name': u'',

u'dri_subworkflow_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

u'dri_subworkflow_link': {u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'', u'id': u''},

u'modified_by_name': u'adminx',

u'modified_by_name': u'adminx',

u'repeat_selector': u'',

u'repeat_selector': u'',

u'email_reminder_sent':错误,

u'email_reminder_sent': False,

u'dri_workflow_template_id': u'',

u'dri_workflow_template_id': u'',

u'status': u'Not Held',

u'status': u'Not Held',

u'direction': u'Outbound',

u'direction': u'Outbound',

u'accept_status_users': u'',

u'accept_status_users': u'',

u'repeat_dow': u'',

u'repeat_dow': u'',

u'description': u'',

u'description': u'',

u'parent': {u'type': u'Accounts', u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'XYZ Funding Inc', u'id': u'xxxx'},

u'parent': {u'type': u'Accounts', u'_acl': {u'fields': [], u'_hash': u'xxxx'}, u'name': u'XYZ Funding Inc', u'id': u'xxxx'},

u'repeat_unit': u'',

u'repeat_unit': u'',

u'deleted':错误,

u'deleted': False,

u'is_customer_journey_parent_activity':错误,

u'is_customer_journey_parent_activity': False,

你'customer_journey_parent_activity_type':你'',

u'customer_journey_parent_activity_type': u'',

u'locked_fields': [],

u'locked_fields': [],

u'email_reminder_time': -1,

u'email_reminder_time': -1,

你'关注':错误,

u'assigned_user_link': {u'id': u'xxxx', u'full_name': u'xxxx', u'_acl': {u'fields': [], u'_hash': u'xxxx'}},

u'assigned_user_link': {u'id': u'xxxx', u'full_name': u'xxxx', u'_acl': {u'fields': [], u'_hash': u'xxxx'}},

u'repeat_type': u'',

u'repeat_type': u'',

u'assigned_user_id': u'seed_sally_id',

u'assigned_user_id': u'seed_sally_id',

u'team_count_link': {u'team_count': u'', u'id': u'1', u'_acl': {u'fields': [], u'_hash':你'xxxx'}},

u'team_count_link': {u'team_count': u'', u'id': u'1', u'_acl': {u'fields': [], u'_hash': u'xxxx'}},

u'dri_workflow_task_template_name': u'',

u'dri_workflow_task_template_name': u'',

u'modified_user_link': {u'id': u'1', u'full_name': u'adminx', u'_acl': {u'fields': {u'last_login': {u'write': u'no', u'create': u'no'}, u'pwd_last_changed': {u'write': u'no', u'create': u'no'}}, u'_hash': u'xxx', u'delete': u'no'}},

u'modified_user_link': {u'id': u'1', u'full_name': u'adminx', u'_acl': {u'fields': {u'last_login': {u'write': u'no', u'create': u'no'}, u'pwd_last_changed': {u'write': u'no', u'create': u'no'}}, u'_hash': u'xxx', u'delete': u'no'}},

u'email_reminder_checked':你'',

u'email_reminder_checked': u'',

u'_module': u'Calls',

u'_module': u'Calls',

u'modified_user_id': u'1',

u'modified_user_id': u'1',

u'repeat_until': u'',

u'repeat_until': u'',

u'name': u'test',

u'name': u'test',

u'date_modified':u'2017-07-17T12:49:23+00:00',

u'date_modified': u'2017-07-17T12:49:23+00:00',

u'accept_status': u'',

u'accept_status': u'',

u'reminder_time': -1,

u'reminder_time': -1,

u'customer_journey_progress': 0,

u'customer_journey_progress': 0,

u'dri_workflow_template_name': u'',

u'dri_workflow_template_name': u'',

u'my_favorite':错误,

u'my_favorite': False,

u'dri_subworkflow_template_name': u'',

u'dri_subworkflow_template_name': u'',

u'dri_workflow_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxx'}, u'name': u'', u'id': u''}, >- u'set_accept_links': u'',

u'dri_workflow_template_link': {u'_acl': {u'fields': [], u'_hash': u'xxx'}, u'name': u'', u'id': u''}, > - u'set_accept_links': u'',

u'repeat_days': u'',

u'repeat_days': u'',

u'is_customer_journey_activity':错误,

u'is_customer_journey_activity': False,

u'repeat_parent_id': u'',

u'repeat_parent_id': u'',

u'team_count': u'',

u'team_count': u'',

u'duration_hours': 0,

u'duration_hours': 0,

u'recurring_source': u''},

u'recurring_source': u''},

推荐答案

奇怪的是,标准 GET 请求中不存在包含Guests"列表的对象,即

Strangely, the object which contains the list of "Guests" is not present in the standard GET request i.e.

https://{INSTANCE}/rest/v10/Calls/{RECORD_ID}

https://{INSTANCE}/rest/v10/Calls/{RECORD_ID}

在进行一些故障排除并查看 Web 应用程序本身中的模型后,我发现 GUI 中的Guests"字段与名为invitees"的模型属性相关联.

After doing some troubleshooting, and looking at the model in the web application itself, I found that the "Guests" field in the GUI ties back to a model property called "invitees".

运行专门引用此字段的网络请求可为您提供链接到呼叫 ID 的记录数组.因此,尝试向该端点运行 GET 请求:

Running a web request specifically referencing this field provides you with an array of records linked to the Call ID. So try running a GET request to this endpoint:

https://{INSTANCE}/rest/v10/Calls/{RECORD_ID}?fields=invitees

https://{INSTANCE}/rest/v10/Calls/{RECORD_ID}?fields=invitees

这应该为您提供类似于以下内容的 JSON:

This should provide you with JSON akin to the below:

{
    "id": "ec041f60-72b1-11e7-89f0-00163ef1f82f",
    "date_modified": "2017-08-08T12:26:47+00:00",
    "invitees": {
        "records": [
            {
                "id": "cf378211-2b38-4fe5-949b-a53040717f04",
                "date_modified": "2017-08-01T16:12:48+00:00",
                "_acl": {
                    "fields": {}
                },
                "_module": "Users",
                "_link": "users"
            },
            {
                "id": "fe1740e6-3fa4-11e7-8fef-00163ef1f82f",
                "date_modified": "2017-05-23T10:45:52+00:00",
                "_acl": {
                    "fields": {}
                },
                "_module": "Contacts",
                "_link": "contacts"
            },
            {
                "id": "dcc526fc-72b1-11e7-a6dd-00163ef1f82f",
                "date_modified": "2017-07-27T09:57:21+00:00",
                "_acl": {
                    "fields": {}
                },
                "_module": "Leads",
                "_link": "leads"
            },
            {
                "id": "89f8a6d1-7df0-0e0b-3568-58a5bb6ecf34",
                "date_modified": "2017-04-06T10:36:16+00:00",
                "_acl": {
                    "fields": {}
                },
                "_module": "Leads",
                "_link": "leads"
            }
        ],
        "next_offset": {
            "contacts": -1,
            "leads": -1,
            "users": -1
        }
    },
    "_acl": {
        "fields": {}
    },
    "contact_name": "test",
    "_module": "Calls"
}

这篇关于SugarCRM 通话记录 REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆