SuiteCRM开发者文档 API v4.1方法

方法

1、Login

登录SuiteCRM并返回用于后续API调用的会话ID。

1)Arguments 

NameTypeDesc
user_autharray
API用户的身份验证详细信息
user_auth[user_name]string SuiteCRM用户的用户名。需要。
user_auth[password]string user_name密码的MD5哈希。需要。
application_namestring 应用程序访问API的标识符
name_value_listname_value_list 一系列的登录选项
name_value_list[language]string 该用户的语言
name_value_list[notifyonsave]bool 保存新记录并将其分配给用户时发送电子邮件通知

2)Response 

NameTypeDesc
idstring 此登录的会话ID。所有其他API调用均必需。
name_value_listname_value_list 包含有关此用户的信息的数组。
name_value_list[user_id]string 登录用户的ID。
name_value_list[user_name]string 登录用户的用户名
name_value_list[user_language]string 登录用户的语言设置
name_value_list[user_currency_id]string 登录用户的货币ID。-99是默认货币。
name_value_list[user_currency_name]string 登录用户的货币名称。
name_value_list[user_is_admin]bool 登录用户是否为管理员
name_value_list[user_default_team_id]string 登录用户的默认团队。此值来自SuiteCRM的分支之前,未使用。
name_value_list[user_default_dateformat]string 登录用户的默认日期格式。
name_value_list[user_default_timeformat]string 登录用户的默认时间格式
name_value_list[user_number_seperator]string 登录用户的数字分隔符。(即以1,000.00格式表示的数字的逗号)
name_value_list[user_decimal_seperator]string 登录用户的小数点分隔符。(即数字为1,000.00的期限)
name_value_list[mobile_max_list_entries]int 已登录用户的最大列表条目(仅获取wl_list_max_entries_per_subpanel配置键)
name_value_list[mobile_max_subpanel_entries]int 已登录用户的最大子面板条目(只需获取wl_list_max_entries_per_subpanel配置键)

2、logout 

将Web用户从SuiteCRM中注销。

1)Arguments 

NameTypeDesc
sessionstring 会话ID。请参阅Login

2)Response 

No response.

3、get_available_modules 

返回可用模块的列表。还返回每个模块的ACL(访问控制列表)

1)Arguments 

NameTypeDesc
sessionstring 会话ID。请参阅Login
filterstring 过滤返回的模块。 ‘default’, ‘mobile’ or ‘all’.

2)Response 

NameTypeDesc
modulesarray 包含模块详细信息的数组。
modules[][module_key]string 该模块键
modules[][module_label]string该模块标签
modules[][favorite_enabled]bool最喜欢的是SugarCRM Professional功能。这总是空的
modules[][acls]array 包含ACL列表的数组-这是允许的操作。
modules[][acls][][action]string 该动作,即编辑,删除,列出等。
modules[][acls][][access]bool 是否允许访问。

4、get_document_revision 

返回特定文档修订的详细信息。

1)Arguments 

NameTypeDesc
sessionstring 会话ID。请参阅Login
istring 要检索的文档修订版的ID

2)Response 

NameTypeDesc
document_revisionarray 包含文档修订详细信息的数组
document_revision[id]string 文档修订版的ID。
document_revision[document_name]string 文件修订的名称
document_revision[revision]int 文档修订的修订号。
document_revision[filename]string 文件名
document_revision[file]binary string 文件的全部内容

5、get_entries 

获取特定模块的条目列表和模块ID列表。(可选)允许返回相关记录。

1)Arguments 

NameTypeDesc
sessionstring 会话ID。请参阅Login
module_namestring 要为其显示条目的模块的名称。
idsarray 要获取的记录ID的数组
ids[]string 编号
select_fieldsarray 要返回的字段数组。一个空数组将返回所有字段。
select_fields[]string 要返回的字段名称
link_name_to_fields_arrayname_value_list 要检索的关系数组。
link_name_to_fields_array[][name]string 要跟随的链接的名称(在中定义 module_name)。
link_name_to_fields_array[][value]array 要为此相关模块返回的字段的数组。
link_name_to_fields_array[][value][]string 名称
track_viewbool 是否将这些记录标记为最近查看。

2)Response 

NameTypeDesc
entry_listarray 记录数组。
entry_list[]array 个人记录的详细信息。
entry_list[][id]string 该记录的ID。
entry_list[][module_name]string 该记录所属的模块的名称。
entry_list[][name_value_list]name_value_list 包含每个返回字段的数组。
entry_list[][name_value_list][]array 单个字段的详细信息。
entry_list[][name_value_list][][name]string 字段名称。
entry_list[][name_value_list][][value]string 字段的值。
relationship_listarray 包含对应记录关系的数组。
relationship_list[]array 对应记录的关系。
relationship_list[link_list]array 此记录的关系列表。
relationship_list[link_list][]array 单一关系的详细信息。
relationship_list[link_list][][name]string 此关系的名称。
relationship_list[link_list][][records]array 此关系的相关记录。
relationship_list[link_list][][records][]array 单个相关记录的详细信息。
relationship_list[link_list][][records][][link_value]name_value_list 此关系的请求字段的数组。
relationship_list[link_list][][records][][link_value][]array 此特定字段的名称/值对。
relationship_list[link_list][][records][][link_value][name]string 字段名称。
relationship_list[link_list][][records][][link_value][value]string 字段的值。

get_entries_count 

返回与给定查询匹配的条目数。

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to display entries for.
querystringAn SQL WHERE clause to apply to the query.
deletedboolWhether to include deleted records

Response 

NameTypeDesc
result_countintThe count of matching entries.

get_entry 

Returns the details for a single record. Optionally allows returning related records.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to fetch the entry for.
idstringThe id of the record to fetch
select_fieldsarrayAn array of fields to return. An empty array will return all fields.
select_fields[]stringThe name of a field to return
link_name_to_fields_arrayname_value_listAn array of relationships to retrieved.
link_name_to_fields_array[][name]stringThe name of the link to follow (as defined in module_name).
link_name_to_fields_array[][value]arrayAn array of the fields to return for this related module.
link_name_to_fields_array[][value][]stringThe field name
track_viewboolWhether to mark these records as recently viewed.

Response 

Identical to the response by get_entries except only one record will be returned.

get_entry_list 

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to fetch the entry for.
querystringAn SQL WHERE clause to apply to the query.
order_bystringIn theory for ordering results but this is unused.
offsetintThe result offset. Useful for pagination.
select_fieldsarrayAn array of fields to return. An empty array will return all fields.
select_fields[]stringThe name of a field to return
link_name_to_fields_arrayname_value_listAn array of relationships to retrieved.
link_name_to_fields_array[][name]stringThe name of the link to follow (as defined in module_name).
link_name_to_fields_array[][value]arrayAn array of the fields to return for this related module.
link_name_to_fields_array[][value][]stringThe field name
max_resultsintThe maximum number of results to return. Useful for pagination.
deletedboolWhether to include deleted records.
favoritesboolFavorites were SugarCRM Professional functionality. This is unused.

Response 

NameTypeDesc
result_countintThe number of returned records.
total_countintThe total number of records matching the query.
next_offsetintThe offset of the next set of records.
entry_listarrayAn array of records.
entry_list[]arrayDetails for an individual record.
entry_list[][id]stringThe id of this record.
entry_list[][module_name]stringThe name of the module this record belongs to.
entry_list[][name_value_list]name_value_listAn array containing each returned field.
entry_list[][name_value_list][]arrayDetails for an individual field.
entry_list[][name_value_list][][name]stringThe name of the field.
entry_list[][name_value_list][][value]stringThe value of the field.
relationship_listarrayAn array of arrays containing the relationships for the corresponding record.
relationship_list[]arrayThe relationships for the corresponding record.
relationship_list[link_list]arrayThe list of relationships for this record.
relationship_list[link_list][]arrayDetails of a single relationship.
relationship_list[link_list][][name]stringThe name of this relationship.
relationship_list[link_list][][records]arrayThe related records for this relationship.
relationship_list[link_list][][records][]arrayDetails of a single related record.
relationship_list[link_list][][records][][link_value]name_value_listAn array of the requested fields for this relationship.
relationship_list[link_list][][records][][link_value][]arrayA name value pair for this particular field.
relationship_list[link_list][][records][][link_value][name]stringThe name of the field.
relationship_list[link_list][][records][][link_value][value]stringThe value of the field.

get_language_definition 

Returns

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
modulesarrayAn array of the modules to return language labels for
modules[]stringThe modules name.
md5boolWhether to return the md5 for each module. Can be useful for caching responses.

Response 

NameTypeDesc
result[<modulename>]</modulename>string/arrayAn array of the labels or an md5 string for <modulename />

get_last_viewed 

Returns a list of the most recently viewed modules for the current user.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namesarrayAn array of the modules to return the last viewed records for.
module_names[]stringThe modules name.

Response 

NameTypeDesc
result[]arrayAn array of the details of recently viewed records
result[][id]intThe id of the tracker row for this viewing
result[][item_id]stringThe id of the viewed record.
result[][item_summary]stringThe summary of the record. This is usually it’s name.
result[][module_name]stringThe module for this record.
result[][monitor_id]stringThe monitor id for this viewing. Legacy and unused.
result[][date_modified]stringThe date that this record was viewed.

get_modified_relationships 

Returns a list of the modified relationships for the current user between one of the Calls, Meetings or Contacts modules.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to retrieve relationships for. Always Users.
related_modulestringThe related module to retrieve records for. One of MeetingsCalls or Contacts.
from_datestringThe start date of the range to search. In the format Y-m-d H:i:s.
to_datestringThe end date of the range to search. In the format Y-m-d H:i:s.
offsetintThe record offset to start with.
max_resultsintThe maximum number of results to return.
deletedboolWhether to include deleted records.
module_user_idstringIn theory the id of the user to return relationships for. However the current user is always used.
select_fieldsarrayAn array of the fields to return for the relationship record. An empty array will return all fields.
select_fields[]stringThe name of the field to return.
relationship_namestringThe name of the relationship between module_name and related_module.
deletion_datestringA start date for the range in which to return deleted records. In the format Y-m-d H:i:s.

Response 

NameTypeDesc
result_countintThe number of returned records.
next_offsetintThe offset of the next set of records.
entry_listarrayAn array of the returned records.
entry_list[]arrayDetails for an individual record.
entry_list[][id]stringThe id of this record.
entry_list[][module_name]stringThe name of the module this record belongs to.
entry_list[][name_value_list]name_value_listAn array containing each returned field.
entry_list[][name_value_list][]arrayA name value pair of the field information.
entry_list[][name_value_list][][name]stringThe name of the field.
entry_list[][name_value_list][][value]stringThe value of the field.
errorarrayAn array containing the error details.
error[number]intThe error number of the error that occurred.
error[name]stringThe name of the error that occurred.
error[description]stringA description of the error that occurred.

get_module_fields 

Returns the field definitions for a given module.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to return field definitions for.
fieldsarrayAn array of fields to return definitions for. An empty array will return all fields.
fields[]stringThe name of the field.

Response 

NameTypeDesc
module_namestringThe name of the module.
table_namestringThe name of the database table for this module.
module_fieldsarrayAn array of the requested fields for this module.
module_fields[]arrayThe details of a specific field.
module_fields[name]stringThe name of the field.
module_fields[type]stringThe type of the field.
module_fields[group]stringThe group of fields that this field belongs to. Used for addresses or link definitions.
module_fields[id_name]stringThe name of the id field on this module for this link if appropriate.
module_fields[label]stringThe display label for this field.
module_fields[required]boolWhether this field is required or not.
module_fields[options]name_value_listAn array of possible options for this field. An empty array if options are not appropriate for this field type.
module_fields[options][]arrayA name value pair of a single option.
module_fields[options][][name]stringThe options key.
module_fields[options][][value]stringThe options display value.
module_fields[related_module]stringThe related module for this field if it is a related type. Empty otherwise.
module_fields[calculated]stringCalculated fields were a SugarCRM professional feature. Will be empty.
module_fields[len]intThe length of this field or an empty string if this is not appropriate for this field type.
link_fieldsarrayAn array of the requested link fields for this module.
link_fields[]arrayThe details of a specific field.
link_fields[name]stringThe name of the field.
link_fields[type]stringThe type of the field. Will always be link.
link_fields[group]stringThe group of fields that this field belongs to. Will be empty for links.
link_fields[id_name]stringThe name of the id field on this module for this link if appropriate.
link_fields[relationship]stringThe relationship name for this link.
link_fields[module]stringThe module this field links to.
link_fields[bean_name]stringThe bean that this field links to.

get_module_fields_md5 

Returns an md5 of the a modules field definitions. Useful for caching.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namesarrayAn array of modules to return the md5 for.
module_names[]stringThe name of the module to return the field definitions md5 for.

Response 

NameTypeDesc
result[]arrayAn array of the md5’s keyed by the module name.
result[<modulename>]</modulename>stringThe md5 string for <modulename />

get_module_layout 

Returns the layout for specified modules and views. Optionally returns an md5 of the layouts.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
modulesarrayAn array of the modules to return layouts for.
modules[]stringThe name of the module.
typesarrayAn array of the types of views to return. Only default is supported.
types[]stringThe type of the views.
viewsarrayAn array of the views to return. One of editdetaillist and subpanel.
views[]stringThe name of the view.
acl_checkboolWhether or not to check that the current user has access to this module and view.
md5boolWhether or not to return the view as an md5 string. Useful for caching.

Response 

NameTypeDesc
resultarrayThe array of results keyed by module name.
result[<modulename>]</modulename>arrayAn array of layouts for <modulename>.</modulename>
result[<modulename>][default]</modulename>arrayAn array of the layouts keyed by the view name.
result[<modulename>][default][<viewname>]</viewname></modulename>array/stringThe layout of the view <viewname> for the module <modulename> or an md5 of the layout. See the section on metadata for the layout format.</modulename></viewname>

get_module_layout_md5 

Returns the md5 of the specified views for the specified modules. Behaves identically to get_module_layout with the md5 parameter set to true.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
modulesarrayAn array of the modules to return layouts for.
modules[]stringThe name of the module.
typesarrayAn array of the types of views to return. Only default is supported.
types[]stringThe type of the views.
viewsarrayAn array of the views to return. One of editdetaillist and subpanel.
views[]stringThe name of the view.
acl_checkboolWhether or not to check that the current user has access to this module and view.

Response 

NameTypeDesc
md5arrayThe array of results keyed by module name.
md5[<modulename>]</modulename>arrayAn array of layouts for <modulename>.</modulename>
md5[<modulename>][default]</modulename>arrayAn array of the layouts keyed by the view name.
md5[<modulename>][default][<viewname>]</viewname></modulename>stringThe md5 of the layout layout of the view <viewname> for the module <modulename>.</modulename></viewname>

get_relationships 

Returns related records given a specific module, record and list of links.

Arguments 

NameTypeDesc
sessionstringThe session id. See login. 
module_namestringThe module to return relationships for.
module_idstringThe record to return relationships for. 
link_field_namestringThe link field to follow for this record. 
related_module_querystringA WHERE clause to use to filter the related modules by. 
related_fieldsarrayAn array of the fields to return for matching records. 
related_fields[]stringThe name of the field. 
related_module_link_name_to_fields_arrayname_value_listAn array of related fields to return for matching records. 
related_module_link_name_to_fields_array[]arrayDetails for a specific link.
related_module_link_name_to_fields_array[][name]stringThe name of the link to follow for matching records. 
related_module_link_name_to_fields_array[][value]arrayAn array of fields to return for this link. 
related_module_link_name_to_fields_array[][value][]stringThe field name. 
deletedboolWhether to include deleted records. 
order_bystringIn theory for ordering results but this is unused. 
offsetintThe record offset to start with. 
limitintThe maximum number of results to return. 

Response 

Identical to the response by get_entries.

get_server_info 

Returns information about the SuiteCRM server. Currently still returns information about the SugarCRM flavor and versions.

Arguments 

No arguments.

Response 

NameTypeDesc
flavorstringThe SugarCRM flavor. For SuiteCRM will always be ‘CE’.
versionstringThe SugarCRM version. Note that this is distinct from the SuiteCRM version
gmt_timestringThe server time in UTC.

get_upcoming_activities 

Returns a list of the 10 upcoming activities (Meetings, Calls and Tasks – also includes Opportunities) for the currently logged in user.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.

Response 

NameTypeDesc
resultarrayAn array of the upcoming activities.
result[]arrayThe details of a single activity.
result[][id]stringThe id of this activity.
result[][module]stringThe module for this activity.
result[][date_due]stringThe due date for this activity.
result[][summary]stringThe summary of this activity. Usually simply it’s name.

get_user_id 

Returns the id of the currently logged in user.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.

Response 

NameTypeDesc
idstringThe id of the current user.

seamless_login 

Marks a session as allowing a seamless login. If successful then the session id (see the login call) can be used in a URL (as MSID) to log the user into SuiteCRM in the browser seamlessly. For example if you have the session id 1234 then accessing the URL example.com/index.php?MSID=1234. The MSID parameter can be used in any valid SuiteCRM URL.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.

Response 

NameTypeDesc
resultboolBoolean indicating success

search_by_module 

Allows searching for records that contain a specific search string.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
search_stringstringThe string to search for.
modulesarrayAn array of the modules to include in the search.
modules[]stringThe modules name.
offsetintThe result offset. Useful for pagination.
max_resultsintThe maximum number of results to return. Useful for pagination.
assigned_user_idstringFilter by the given assigned user. Leave blank to do no user filtering.
select_fieldsarrayAn array of the fields to return for the found records. An empty array will return all fields.
select_fields[]stringThe name of the field to return.
unified_search_onlyboolWhether to only return records for modules that participate in the global search.
favoritesboolFavorites were SugarCRM Professional functionality. This is unused.

Response 

NameTypeDesc
entry_listarrayAn array of the results for each module.
entry_list[]arrayResults for a specific module.
entry_list[][name]stringThe name of the module that this entry contains results for.
entry_list[][records]arrayAn array of the record results.
entry_list[][records][]name_value_listA name value list of records id and name.
entry_list[][records][][id]arrayA name value pair containing the id of this record.
entry_list[][records][][name]arrayA name value pair containing the name of this record.

set_document_revision 

Creates a new document revision for a document.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
notearrayAn array containing the document revision details.
note[id]stringThe id of the document to add this revision to.
note[file]binary stringThe binary contents of the file, base 64 encoded.
note[filename]stringThe name of the file.
note[revision]intThe revision number for this revision.

Response 

NameTypeDesc
idstringThe id of the newly created document revision.

set_entries 

Creates or updates a list of records.

Arguments 

Supplying a value for the id field will perform an update for that record.

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to create/update records for.
name_value_listsname_value_listAn array of the details for each record to create/update.
name_value_lists[]arrayDetails of an individual record.
name_value_lists[][]arrayA name value pair for each field value.
name_value_lists[][][name]arrayThe name of the field.
name_value_lists[][][value]arrayThe value for the field.

Response 

NameTypeDesc
idsarrayAn array of the resulting ids. Returned in the same order as specified in the call to set_entries.
ids[]arrayThe id for this record.

set_entry 

Creates or updates a single record.

Arguments 

Supplying a value for the id field will perform an update for that record.

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to create/update a record for.
name_value_listname_value_listAn array of the fields for the new/updated record.
name_value_lists[]arrayA name value pair for each field value.
name_value_lists[][name]arrayThe name of the field.
name_value_lists[][value]arrayThe value for the field.

Response 

NameTypeDesc
idstringThe id of the newly created or updated record.

get_note_attachment 

Returns the details of a given note attachment.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
idstringThe id of the note to retrieve information for.

Response 

NameTypeDesc
note_attachmentarrayThe details for the note attachment.
note_attachment[id]stringThe id of the note to retrieve information for.
note_attachment[filename]stringThe filename of the file
note_attachment[file]binary stringThe full contents of the file
note_attachment[related_module_id]stringThe id of the record that this attachment is related to.
note_attachment[related_module_name]stringThe module of the record that this attachment is related to.

set_note_attachment 

Creates a not attachment for a specified record.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
notearrayThe details for the note attachment.
note[id]stringThe id of the note to add an attachment for.
note[filename]stringThe filename of the file
note[file]binary stringThe full contents of the file base 64 encoded.

Response 

NameTypeDesc
idstringThe id of the note for this attachment.

set_relationship 

Sets a relationship between a record and other records.

Arguments 

NameTypeDesc
sessionstringThe session id. See login.
module_namestringThe name of the module to relate records to.
module_idstringThe id of the record to relate records to.
link_field_namestringThe name of the link field on the module through which records will be related.
related_idsarrayAn array of record ids to relate.
related_ids[]stringThe id of a record to relate.
name_value_listname_value_listA name value list of additional relationship fields to set.
name_value_list[]arrayA name value pair for a relationship field to set.
name_value_list[][name]stringThe name of the field to set.
name_value_list[][value]stringThe value of the field to set.
deleteboolWhether or not to delete the specified relationship instead of creating/updating it.

Response 

NameTypeDesc
createdintThe number of relationships created.
failedintThe number of relationships that failed to be created/deleted.
deletedintThe number of relationships deleted.

set_relationships 

Sets relationships between multiple records.

Arguments 

NameTypeDesc  
sessionstringThe session id. See login.  
module_namesarrayAn array of modules to relate records to.
module_names[]stringThe name of the module to relate records to. 
module_idsarrayAn array of the ids of records to relate records to.
module_ids[]stringThe id of the record to relate records to.
link_field_namesstringAn array of the link names through which records will be related.
link_field_names[]stringThe name of the link field on the module through which records will be related.  
related_idsarrayAn array of an array of record ids for each module specified.  
related_ids[]arrayAn array of record ids for the corresponding module.
related_ids[][]stringThe record id.  
name_value_listsarrayAn array of an array of name value list of additional relationship fields to set.
name_value_lists[]name_value_listAn array of name value pairs for the relationship fields of the corresponding module.  
name_value_lists[][name]stringThe name of the field to set.  
name_value_lists[][value]stringThe value of the field to set.
delete_arrayarrayAn array of booleans indicating whether or not the relationship should be deleted for each module.  
delete_array[]boolWhether or not to delete the specified relationship instead of creating/updating it.  

Response 

NameTypeDesc
createdintThe number of relationships created.
failedintThe number of relationships that failed to be created/deleted.
deletedintThe number of relationships deleted.

推荐阅读

  1. SuiteCRM 8.1.2 刚刚发布!
  2. SuiteCRM 8.1.1 & 7.12.6 发布
  3. 为了官方更好的技术服务,请捐赠SuiteCRM
  4. SuiteCRM 8.1发布-官方版本再更新!
  5. 苏格兰公司 SuiteCRM 再次获奖
  6. 安全和维护补丁:SuiteCRM 8.0.4 & 7.12.5 发布
  7. 将 SuiteCRM 升级到更新版本
  8. SuiteCRM 升级环境(PHP\MySQL\Apache)要求

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注