【发布时间】:2016-07-27 07:27:16
【问题描述】:
我正在尝试使用 rest API v4_1 从 Sugar-CRM 获取条目。 当我尝试在 select_fields 中传递值时,我得到空响应.. 当我传递空的 select_fields 数组时,我得到了成功的响应..
这是我的代码
var settings = {
"async": true,
"crossDomain": true,
"url": "http://mycrm.com/service/v4_1/rest.php",
"method": "POST",
"headers": {
"cache-control": "no-cache",
"postman-token": "e85b8af0-3234-45c8-f5ec-abe8xx4d6efd",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"method": "get_entry",
"input_type": "json",
"response_type": "json",
"rest_data": "{\"session\":\"xxyyxxsmkdemnmdm1212\",\"module_name\":\"Accounts\",\"id\":\"12345-6789-1214-1234\",\"select_fields\":{},\"link_name_to_fields_array\":{ }, \"track_view\":true}"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
当我在 select_fields 中传递空数组时,上面的代码成功地给了我响应..
注意:我在上面更改了我的会话、ID、邮递员令牌。这些不是实际值。
【问题讨论】:
-
您在 select_fields 中要求什么值?
-
我只想传递 select_fields 中的特定字段,例如id,first_name,last_name
标签: arrays web-services sugarcrm