方法
1、Login
登录SuiteCRM并返回用于后续API调用的会话ID。
1)Arguments
Name Type Desc user_auth array API用户的身份验证详细信息 user_auth[user_name] string SuiteCRM用户的用户名。需要。 user_auth[password] string user_name密码的MD5哈希。需要。 application_name string 应用程序访问API的标识符 name_value_list name_value_list 一系列的登录选项 name_value_list[language] string 该用户的语言 name_value_list[notifyonsave] bool 保存新记录并将其分配给用户时发送电子邮件通知
2)Response
Name Type Desc id string 此登录的会话ID。所有其他API调用均必需。 name_value_list name_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
Name Type Desc session string 会话ID。请参阅Login 。
2)Response
No response.
3、get_available_modules
返回可用模块的列表。还返回每个模块的ACL(访问控制列表)
1)Arguments
Name Type Desc session string 会话ID。请参阅Login 。 filter string 过滤返回的模块。 ‘default’, ‘mobile’ or ‘all’.
2)Response
Name Type Desc modules array 包含模块详细信息的数组。 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
Name Type Desc session string 会话ID。请参阅Login 。 i string 要检索的文档修订版的ID
2)Response
Name Type Desc document_revision array 包含文档修订详细信息的数组 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
Name Type Desc session string 会话ID。请参阅Login 。 module_name string 要为其显示条目的模块的名称。 ids array 要获取的记录ID的数组 ids[] string 编号 select_fields array 要返回的字段数组。一个空数组将返回所有字段。 select_fields[] string 要返回的字段名称 link_name_to_fields_array name_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_view bool 是否将这些记录标记为最近查看。
2)Response
Name Type Desc entry_list array 记录数组。 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_list array 包含对应记录关系的数组。 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 字段的值。
返回与给定查询匹配的条目数。
Name Type Desc session string The session id. See login. module_name string The name of the module to display entries for. query string An SQL WHERE clause to apply to the query. deleted bool Whether to include deleted records
Name Type Desc result_count int The count of matching entries.
Returns the details for a single record. Optionally allows returning related records.
Name Type Desc session string The session id. See login. module_name string The name of the module to fetch the entry for. id string The id of the record to fetch select_fields array An array of fields to return. An empty array will return all fields. select_fields[] string The name of a field to return link_name_to_fields_array name_value_list An array of relationships to retrieved. link_name_to_fields_array[][name] string The name of the link to follow (as defined in module_name
). link_name_to_fields_array[][value] array An array of the fields to return for this related module. link_name_to_fields_array[][value][] string The field name track_view bool Whether to mark these records as recently viewed.
Identical to the response by get_entries
except only one record will be returned.
Name Type Desc session string The session id. See login. module_name string The name of the module to fetch the entry for. query string An SQL WHERE clause to apply to the query. order_by string In theory for ordering results but this is unused. offset int The result offset. Useful for pagination. select_fields array An array of fields to return. An empty array will return all fields. select_fields[] string The name of a field to return link_name_to_fields_array name_value_list An array of relationships to retrieved. link_name_to_fields_array[][name] string The name of the link to follow (as defined in module_name
). link_name_to_fields_array[][value] array An array of the fields to return for this related module. link_name_to_fields_array[][value][] string The field name max_results int The maximum number of results to return. Useful for pagination. deleted bool Whether to include deleted records. favorites bool Favorites were SugarCRM Professional functionality. This is unused.
Name Type Desc result_count int The number of returned records. total_count int The total number of records matching the query. next_offset int The offset of the next set of records. entry_list array An array of records. entry_list[] array Details for an individual record. entry_list[][id] string The id of this record. entry_list[][module_name] string The name of the module this record belongs to. entry_list[][name_value_list] name_value_list An array containing each returned field. entry_list[][name_value_list][] array Details for an individual field. entry_list[][name_value_list][][name] string The name of the field. entry_list[][name_value_list][][value] string The value of the field. relationship_list array An array of arrays containing the relationships for the corresponding record. relationship_list[] array The relationships for the corresponding record. relationship_list[link_list] array The list of relationships for this record. relationship_list[link_list][] array Details of a single relationship. relationship_list[link_list][][name] string The name of this relationship. relationship_list[link_list][][records] array The related records for this relationship. relationship_list[link_list][][records][] array Details of a single related record. relationship_list[link_list][][records][][link_value] name_value_list An array of the requested fields for this relationship. relationship_list[link_list][][records][][link_value][] array A name value pair for this particular field. relationship_list[link_list][][records][][link_value][name] string The name of the field. relationship_list[link_list][][records][][link_value][value] string The value of the field.
Returns
Name Type Desc session string The session id. See login. modules array An array of the modules to return language labels for modules[] string The modules name. md5 bool Whether to return the md5 for each module. Can be useful for caching responses.
Name Type Desc result[<modulename>]</modulename> string/array An array of the labels or an md5 string for <modulename />
Returns a list of the most recently viewed modules for the current user.
Name Type Desc session string The session id. See login. module_names array An array of the modules to return the last viewed records for. module_names[] string The modules name.
Name Type Desc result[] array An array of the details of recently viewed records result[][id] int The id of the tracker row for this viewing result[][item_id] string The id of the viewed record. result[][item_summary] string The summary of the record. This is usually it’s name. result[][module_name] string The module for this record. result[][monitor_id] string The monitor id for this viewing. Legacy and unused. result[][date_modified] string The date that this record was viewed.
Returns a list of the modified relationships for the current user between one of the Calls, Meetings or Contacts modules.
Name Type Desc session string The session id. See login. module_name string The name of the module to retrieve relationships for. Always Users
. related_module string The related module to retrieve records for. One of Meetings
, Calls
or Contacts
. from_date string The start date of the range to search. In the format Y-m-d H:i:s
. to_date string The end date of the range to search. In the format Y-m-d H:i:s
. offset int The record offset to start with. max_results int The maximum number of results to return. deleted bool Whether to include deleted records. module_user_id string In theory the id of the user to return relationships for. However the current user is always used. select_fields array An array of the fields to return for the relationship record. An empty array will return all fields. select_fields[] string The name of the field to return. relationship_name string The name of the relationship between module_name
and related_module
. deletion_date string A start date for the range in which to return deleted records. In the format Y-m-d H:i:s
.
Name Type Desc result_count int The number of returned records. next_offset int The offset of the next set of records. entry_list array An array of the returned records. entry_list[] array Details for an individual record. entry_list[][id] string The id of this record. entry_list[][module_name] string The name of the module this record belongs to. entry_list[][name_value_list] name_value_list An array containing each returned field. entry_list[][name_value_list][] array A name value pair of the field information. entry_list[][name_value_list][][name] string The name of the field. entry_list[][name_value_list][][value] string The value of the field. error array An array containing the error details. error[number] int The error number of the error that occurred. error[name] string The name of the error that occurred. error[description] string A description of the error that occurred.
Returns the field definitions for a given module.
Name Type Desc session string The session id. See login. module_name string The name of the module to return field definitions for. fields array An array of fields to return definitions for. An empty array will return all fields. fields[] string The name of the field.
Name Type Desc module_name string The name of the module. table_name string The name of the database table for this module. module_fields array An array of the requested fields for this module. module_fields[] array The details of a specific field. module_fields[name] string The name of the field. module_fields[type] string The type of the field. module_fields[group] string The group of fields that this field belongs to. Used for addresses or link definitions. module_fields[id_name] string The name of the id field on this module for this link if appropriate. module_fields[label] string The display label for this field. module_fields[required] bool Whether this field is required or not. module_fields[options] name_value_list An array of possible options for this field. An empty array if options are not appropriate for this field type. module_fields[options][] array A name value pair of a single option. module_fields[options][][name] string The options key. module_fields[options][][value] string The options display value. module_fields[related_module] string The related module for this field if it is a related type. Empty otherwise. module_fields[calculated] string Calculated fields were a SugarCRM professional feature. Will be empty. module_fields[len] int The length of this field or an empty string if this is not appropriate for this field type. link_fields array An array of the requested link fields for this module. link_fields[] array The details of a specific field. link_fields[name] string The name of the field. link_fields[type] string The type of the field. Will always be link. link_fields[group] string The group of fields that this field belongs to. Will be empty for links. link_fields[id_name] string The name of the id field on this module for this link if appropriate. link_fields[relationship] string The relationship name for this link. link_fields[module] string The module this field links to. link_fields[bean_name] string The bean that this field links to.
Returns an md5 of the a modules field definitions. Useful for caching.
Name Type Desc session string The session id. See login. module_names array An array of modules to return the md5 for. module_names[] string The name of the module to return the field definitions md5 for.
Name Type Desc result[] array An array of the md5’s keyed by the module name. result[<modulename>]</modulename> string The md5 string for <modulename />
Returns the layout for specified modules and views. Optionally returns an md5 of the layouts.
Name Type Desc session string The session id. See login. modules array An array of the modules to return layouts for. modules[] string The name of the module. types array An array of the types of views to return. Only default
is supported. types[] string The type of the views. views array An array of the views to return. One of edit
, detail
, list
and subpanel
. views[] string The name of the view. acl_check bool Whether or not to check that the current user has access to this module and view. md5 bool Whether or not to return the view as an md5 string. Useful for caching.
Name Type Desc result array The array of results keyed by module name. result[<modulename>]</modulename> array An array of layouts for <modulename>.</modulename> result[<modulename>][default]</modulename> array An array of the layouts keyed by the view name. result[<modulename>][default][<viewname>]</viewname></modulename> array/string The 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>
Returns the md5 of the specified views for the specified modules. Behaves identically to get_module_layout with the md5 parameter set to true.
Name Type Desc session string The session id. See login. modules array An array of the modules to return layouts for. modules[] string The name of the module. types array An array of the types of views to return. Only default
is supported. types[] string The type of the views. views array An array of the views to return. One of edit
, detail
, list
and subpanel
. views[] string The name of the view. acl_check bool Whether or not to check that the current user has access to this module and view.
Name Type Desc md5 array The array of results keyed by module name. md5[<modulename>]</modulename> array An array of layouts for <modulename>.</modulename> md5[<modulename>][default]</modulename> array An array of the layouts keyed by the view name. md5[<modulename>][default][<viewname>]</viewname></modulename> string The md5 of the layout layout of the view <viewname> for the module <modulename>.</modulename></viewname>
Returns related records given a specific module, record and list of links.
Name Type Desc session string The session id. See login. module_name string The module to return relationships for. module_id string The record to return relationships for. link_field_name string The link field to follow for this record. related_module_query string A WHERE clause to use to filter the related modules by. related_fields array An array of the fields to return for matching records. related_fields[] string The name of the field. related_module_link_name_to_fields_array name_value_list An array of related fields to return for matching records. related_module_link_name_to_fields_array[] array Details for a specific link. related_module_link_name_to_fields_array[][name] string The name of the link to follow for matching records. related_module_link_name_to_fields_array[][value] array An array of fields to return for this link. related_module_link_name_to_fields_array[][value][] string The field name. deleted bool Whether to include deleted records. order_by string In theory for ordering results but this is unused. offset int The record offset to start with. limit int The maximum number of results to return.
Identical to the response by get_entries
.
Returns information about the SuiteCRM server. Currently still returns information about the SugarCRM flavor and versions.
No arguments.
Name Type Desc flavor string The SugarCRM flavor. For SuiteCRM will always be ‘CE’. version string The SugarCRM version. Note that this is distinct from the SuiteCRM version gmt_time string The server time in UTC.
Returns a list of the 10 upcoming activities (Meetings, Calls and Tasks – also includes Opportunities) for the currently logged in user.
Name Type Desc session string The session id. See login.
Name Type Desc result array An array of the upcoming activities. result[] array The details of a single activity. result[][id] string The id of this activity. result[][module] string The module for this activity. result[][date_due] string The due date for this activity. result[][summary] string The summary of this activity. Usually simply it’s name.
Returns the id of the currently logged in user.
Name Type Desc session string The session id. See login.
Name Type Desc id string The id of the current user.
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.
Name Type Desc session string The session id. See login.
Name Type Desc result bool Boolean indicating success
Allows searching for records that contain a specific search string.
Name Type Desc session string The session id. See login. search_string string The string to search for. modules array An array of the modules to include in the search. modules[] string The modules name. offset int The result offset. Useful for pagination. max_results int The maximum number of results to return. Useful for pagination. assigned_user_id string Filter by the given assigned user. Leave blank to do no user filtering. select_fields array An array of the fields to return for the found records. An empty array will return all fields. select_fields[] string The name of the field to return. unified_search_only bool Whether to only return records for modules that participate in the global search. favorites bool Favorites were SugarCRM Professional functionality. This is unused.
Name Type Desc entry_list array An array of the results for each module. entry_list[] array Results for a specific module. entry_list[][name] string The name of the module that this entry contains results for. entry_list[][records] array An array of the record results. entry_list[][records][] name_value_list A name value list of records id and name. entry_list[][records][][id] array A name value pair containing the id of this record. entry_list[][records][][name] array A name value pair containing the name of this record.
Creates a new document revision for a document.
Name Type Desc session string The session id. See login. note array An array containing the document revision details. note[id] string The id of the document to add this revision to. note[file] binary string The binary contents of the file, base 64 encoded. note[filename] string The name of the file. note[revision] int The revision number for this revision.
Name Type Desc id string The id of the newly created document revision.
Creates or updates a list of records.
Supplying a value for the id field will perform an update for that record.
Name Type Desc session string The session id. See login. module_name string The name of the module to create/update records for. name_value_lists name_value_list An array of the details for each record to create/update. name_value_lists[] array Details of an individual record. name_value_lists[][] array A name value pair for each field value. name_value_lists[][][name] array The name of the field. name_value_lists[][][value] array The value for the field.
Name Type Desc ids array An array of the resulting ids. Returned in the same order as specified in the call to set_entries
. ids[] array The id for this record.
Creates or updates a single record.
Supplying a value for the id field will perform an update for that record.
Name Type Desc session string The session id. See login. module_name string The name of the module to create/update a record for. name_value_list name_value_list An array of the fields for the new/updated record. name_value_lists[] array A name value pair for each field value. name_value_lists[][name] array The name of the field. name_value_lists[][value] array The value for the field.
Name Type Desc id string The id of the newly created or updated record.
Returns the details of a given note attachment.
Name Type Desc session string The session id. See login. id string The id of the note to retrieve information for.
Name Type Desc note_attachment array The details for the note attachment. note_attachment[id] string The id of the note to retrieve information for. note_attachment[filename] string The filename of the file note_attachment[file] binary string The full contents of the file note_attachment[related_module_id] string The id of the record that this attachment is related to. note_attachment[related_module_name] string The module of the record that this attachment is related to.
Creates a not attachment for a specified record.
Name Type Desc session string The session id. See login. note array The details for the note attachment. note[id] string The id of the note to add an attachment for. note[filename] string The filename of the file note[file] binary string The full contents of the file base 64 encoded.
Name Type Desc id string The id of the note for this attachment.
Sets a relationship between a record and other records.
Name Type Desc session string The session id. See login. module_name string The name of the module to relate records to. module_id string The id of the record to relate records to. link_field_name string The name of the link field on the module through which records will be related. related_ids array An array of record ids to relate. related_ids[] string The id of a record to relate. name_value_list name_value_list A name value list of additional relationship fields to set. name_value_list[] array A name value pair for a relationship field to set. name_value_list[][name] string The name of the field to set. name_value_list[][value] string The value of the field to set. delete bool Whether or not to delete the specified relationship instead of creating/updating it.
Name Type Desc created int The number of relationships created. failed int The number of relationships that failed to be created/deleted. deleted int The number of relationships deleted.
Sets relationships between multiple records.
Name Type Desc session string The session id. See login. module_names array An array of modules to relate records to. module_names[] string The name of the module to relate records to. module_ids array An array of the ids of records to relate records to. module_ids[] string The id of the record to relate records to. link_field_names string An array of the link names through which records will be related. link_field_names[] string The name of the link field on the module through which records will be related. related_ids array An array of an array of record ids for each module specified. related_ids[] array An array of record ids for the corresponding module. related_ids[][] string The record id. name_value_lists array An array of an array of name value list of additional relationship fields to set. name_value_lists[] name_value_list An array of name value pairs for the relationship fields of the corresponding module. name_value_lists[][name] string The name of the field to set. name_value_lists[][value] string The value of the field to set. delete_array array An array of booleans indicating whether or not the relationship should be deleted for each module. delete_array[] bool Whether or not to delete the specified relationship instead of creating/updating it.
Name Type Desc created int The number of relationships created. failed int The number of relationships that failed to be created/deleted. deleted int The number of relationships deleted.