id
stringlengths
14
16
text
stringlengths
33
5.27k
source
stringlengths
105
270
1dfaf94002a4-0
Migration Migrating Sugar instances and external data. TopicsMigrating From On-Site to SugarCloudThe following article describes the process of migrating an on-site deployment to the SugarCloud environment.Migrating From SugarCloud to On-SiteOccasionally, system administrators will have the need to deploy versions of their instance hosted on Sugar's cloud service to an on-site system. Reasons for this type of deployment are:Migrating From a Broken Instance to a Clean InstallThe following article describes the process of migrating a potentially broken instance to a clean install.Importing RecordsCovers the Sugar structure when migrating data into the application. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/index.html
3a7d66ccdcad-0
Migrating From a Broken Instance to a Clean Install Overview The following article describes the process of migrating a potentially broken instance to a clean install. This is beneficial in the use case of corrupted core files. This will not correct issues caused by broken customizations. Requirements To migrate your instance to a clean install you will need to do the following: Have full permissions to modify the system files. Identify your Sugar version. Note: The version of your instance can be found by clicking the Help link in Sugar's footer or navigating to the About page from your user menu.  Once you have identified your Sugar version, you will need to download the full installer package of your Sugar version from your account's Downloads page. If you are on 13.0.0 Pro, you must download the SugarPro-13.0.0.zip package or the migration will not work. Migrating to a New Instance Make a complete backup of your broken instance. This includes both the filesystem and database. Extract the contents of your downloaded Sugar package ( Sugar<Edition>-<Version>.zip ) to your web directory. This will be your clean Sugar directory that we will migrate your existing instance to. You will then need to copy the following directories and files from your broken instance to the clean instance: ./config.php ./config_override.php (if it exists) ./custom/ ./upload/ ./cache/images/ - This is optional and contains the embedded emails displayed in the UI. Note: If you are on a version prior to 6.4.0, you will also need to copy over the entire ./cache/ directory.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_a_Broken_Instance_to_a_clean_install/index.html
3a7d66ccdcad-1
Next, you will need to identify if you have any custom modules. These folders will reside in your ./modules/ directory and have a naming format of <key>_<module name>. You will need to copy these files to their corresponding directory in the clean instance you extracted in step 2. Once the files have been moved to the clean instance, you can remove your old instances files and move the clean instance in its place. If you choose to move the instance to a new location on the server, you will need to update the $sugar_config['site_url'] parameter in your ./config.php and/or ./config_override.php files. Reset your filesystem permissions. Log into your instance as an administrator and navigate to Admin > Repair > Quick Repair and Rebuild. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_a_Broken_Instance_to_a_clean_install/index.html
c7bb333ef2c9-0
Importing Records Covers the Sugar structure when migrating data into the application. TopicsImporting Email AddressesRecommended approaches when Importing email addresses. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/index.html
923a96ebd71a-0
Importing Email Addresses Overview Recommended approaches when Importing email addresses. Importing via API Sugar comes out of the box with an API that can be called from custom applications utilizing the REST interface. The API can be used to mass create and update records in Sugar with external data. For more information on the REST API in Sugar, please refer to the Web Services documentation. Importing New Records When importing new records into Sugar through the API, modules with relationships to email addresses can utilize the email1 field or the email link field to specify email addresses for a record. Email1 Field When using the email1 field, the default functionality is to import the email address specified as the primary address. Assuming the email address does not already exist in the database, the email address is then flagged as being valid and is not opted out. Using the /<module> POST endpoint, you can send the following JSON payload to create a contact record with a primary email address using the email1 field: POST URL: http://<site url>/rest/v10/Contacts { "first_name":"Rob", "last_name":"Robertson", "email1":"[email protected]" } Note: For importing multiple email addresses, you will need to use the email link field described below. Email Link Field When using the email link field, you can specify multiple email addresses to assign to the record. You may specify the following additional information regarding each email address being added: invalid_email : Specify this email address as being invalid opt_out : Specify this email address as being opted out primary_address : Specify this email address as the primary Using the /<module> POST endpoint, you can send the following JSON payload to create a contact record with multiple email addresses using the email link field: POST URL: http://<site url>/rest/v10/Contacts {
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/Importing_Email_Addresses/index.html
923a96ebd71a-1
{ "first_name":"Rob", "last_name":"Robertson", "email":[ { "email_address":"[email protected]", "primary_address":"1", "invalid_email":"0", "opt_out":"0" }, { "email_address":"[email protected]", "primary_address":"0", "invalid_email":"0", "opt_out":"1" } ] } For more information on the /<module>/:record POST endpoint, you can refer to your instance's help documentation found at: http://<site url>/rest/v10/help Or you can reference the <module> POST PHP example. Updating Existing Records When updating existing records in Sugar through the API, modules with relationships to email addresses can also utilize the email1 field or the email link field to specify email addresses for a record. Email1 Field When using the email1 field, the default functionality is to replace the existing email primary address. Assuming the email does not already exist in the database, the new email address is flagged as being valid and is not opted out. Using the /<module>/:record PUT endpoint, you can send the following JSON payload to update a contact records primary email address: PUT URL: http://<site url>/rest/v10/Contacts/<record id> { "email1":"[email protected]" } Note: This will replace the current email address on the record with the new data. The old email address will no longer be associated with the record. Email Link Field When using the email link field, you can specify multiple email addresses to update the record with. You may specify the following additional information regarding each email address being added: invalid_email : Specify this email address as being invalid
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/Importing_Email_Addresses/index.html
923a96ebd71a-2
invalid_email : Specify this email address as being invalid opt_out : Specify this email address as being opted out primary_address : Specify this email address as the primary Using the /<module>/:record PUT endpoint, you can send the following JSON payload to update a contact record with multiple email addresses: PUT URL: http://<site url>/rest/v10/Contacts/<record id> { "email":[ { "email_address":"[email protected]", "primary_address":"1", "invalid_email":"0", "opt_out":"0" }, { "email_address":"[email protected]", "primary_address":"0", "invalid_email":"0", "opt_out":"1" } ] } For more information on the /<module>/:record PUT endpoint, you can refer to your instance's help documentation found at: http://<site url>/rest/v10/help Or you can reference the <module>/:record PUT PHP example. Importing via Database When importing records into Sugar directly via the database, it is important that you understand the data structure involved before loading data. Email addresses are not stored directly on the table for the module being imported in, but are related via the email_addr_bean_rel table. The table structure for email addresses can be seen from the database via the following SQL statement: SELECT email_addr_bean_rel.bean_id, email_addr_bean_rel.bean_module, email_addresses.email_address FROM email_addr_bean_rel INNER JOIN email_addresses ON email_addresses.id = email_addr_bean_rel.email_address_id AND email_addr_bean_rel.deleted = 0 WHERE email_addresses.deleted = 0; Checking for Duplicates
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/Importing_Email_Addresses/index.html
923a96ebd71a-3
WHERE email_addresses.deleted = 0; Checking for Duplicates Email addresses can become duplicated in Sugar from a variety of sources including API calls, imports, and from data entry. There are a few ways to have the system check for duplicate contact records, but not many of those methods work for checking email addresses for duplicates. The following section will demonstrate how to find and clean up duplicate email addresses using SQL. The following SQL query can be used to locate if any email addresses are being used against more than one bean record within Sugar: SELECT email_addresses.email_address, COUNT(*) AS email_address_count FROM email_addr_bean_rel INNER JOIN email_addresses ON email_addresses.id = email_addr_bean_rel.email_address_id AND email_addr_bean_rel.deleted = 0 WHERE email_addresses.deleted = 0 GROUP BY email_addresses.email_address HAVING COUNT(*) > 1; Note: If you convert a Lead record to a Contact record, both the Lead and the Contact will be related to the same Email Address and will return as having duplicates in this query. You can add the following line to the WHERE clause to filter the duplicate check down to only one bean type: AND email_addr_bean_rel.bean_module = 'Contacts' Email addresses can not only be duplicated in the system but can occasionally be missing critical data. Each bean record with an email address assigned to it should have an email address designated the primary. The following query will locate any bean records that have at least one email address, where there is not an email address designated as the primary: SELECT email_addr_bean_rel.bean_module, email_addr_bean_rel.bean_id, COUNT(*) AS email_count, COUNT(primary_email_addr_bean_rel.id) AS primary_email_count FROM email_addr_bean_rel LEFT JOIN email_addr_bean_rel primary_email_addr_bean_rel
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/Importing_Email_Addresses/index.html
923a96ebd71a-4
LEFT JOIN email_addr_bean_rel primary_email_addr_bean_rel ON primary_email_addr_bean_rel.bean_module = email_addr_bean_rel.bean_module AND primary_email_addr_bean_rel.bean_id = email_addr_bean_rel.bean_id AND primary_email_addr_bean_rel.primary_address = '1' AND primary_email_addr_bean_rel.deleted = '0' WHERE email_addr_bean_rel.deleted = '0' GROUP BY email_addr_bean_rel.bean_module, email_addr_bean_rel.bean_id HAVING primary_email_count < 1; Removing Duplicates If it is determined you have duplicate email addresses being used in your system, you can use the following query to clean up the records: START TRANSACTION; CREATE TABLE email_addr_bean_rel_tmp SELECT * FROM email_addr_bean_rel WHERE deleted = '0' GROUP BY email_address_id, bean_module, bean_id ORDER BY primary_address DESC; TRUNCATE TABLE email_addr_bean_rel; INSERT INTO email_addr_bean_rel SELECT * FROM email_addr_bean_rel_tmp; SELECT COUNT(*) AS repetitions, date_modified, bean_id, bean_module FROM email_addr_bean_rel WHERE deleted = '0' GROUP BY bean_id, bean_module, email_address_id HAVING repetitions > 1; COMMIT; Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Importing_Records/Importing_Email_Addresses/index.html
85627b082c76-0
Migrating From SugarCloud to On-Site Overview Occasionally, system administrators will have the need to deploy versions of their instance hosted on Sugar's cloud service to an on-site system. Reasons for this type of deployment are: Testing locally-developed modules Migrating from SugarCloud to on-site Prerequisites Before migrating Sugar to an on-site environment, you will need to request a backup of your SugarCloud system by filing a case with the Sugar Support team. Once the backup request is received, SugarCRM will provide an FTP account where the following files can be downloaded:instance_name-YYYYMMDDHHmm.sql.gz (backup of database) instance_name-YYYYMMDDHHmm-triggers.sql.gz (backup of database triggers) instance_name-YYYYMMDDHHmm.files.tgz (backup of file system) The local system must be running MySQL. Converting the database to another system, such as SQL Server or Oracle, requires special handling. For more information regarding this type of conversion, please contact your Account Manager. On-site system administrators must be familiar with their stack and the tools (gunzip, tar, mysqladmin, mysql, etc.) referenced in this guide. Note: It is the system administrator's responsibility to diagnose and troubleshoot issues specific to the stack (permissions, environment variables, etc.). Steps to Complete Deploy the backup files to a local system using the following steps: Extract and import the SQL data as follows: Extract the SQL file via an archive utility (e.g. 7-Zip) or via command line such as: gunzip instance_name-YYYYMMDDHHmm.sql.gz Create a database on your MySQL server via command line: mysqladmin -u mysql_username -p create instance_name Or, if already logged into MySQL, with a command such as: CREATE DATABASE instance_name;
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_Sugar_Cloud_to_On-Site/index.html
85627b082c76-1
Or, if already logged into MySQL, with a command such as: CREATE DATABASE instance_name; Import the SQL data to your MySQL server via the command line: mysql -u mysql_username database_name -p < instance_name-YYYYMMDDHHmm.sql Extract the Triggers file via an archive utility (e.g. 7-Zip) or via command line such as: gunzip instance_name-YYYYMMDDHHmm.triggers.sql.gz Import the Triggers data to your MySQL server via the command line: mysql -u mysql_username database_name -p < instance_name-YYYYMMDDHHmm.triggers.sql Extract the tar file to your web server's web root directory (e.g. /var/www/html) with the following command: tar -C /var/www/html -xzf instance_name-YYYYMMDDHHmm.files.tgz This will create a directory named "instance_name-YYYYMMDDHHmm" in your web root directory. Rename the newly created directory: mv /var/www/html/instance_name-YYYYMMDDHHmm /var/www/html/instance_name For Linux-based servers, perform the following actions: Change the ownership of the directory to be accessible by the Apache user and group. Please note that the user and group (e.g. apache, www-data, etc.) values can vary depending on your web server configuration. chown -R apache:apache /var/www/html/instance_name Change the permissions of the directory to ensure files can be accessed by the application. The actual permission values may differ depending on server security settings. chmod -R 770 /var/www/html/instance_name Edit the ./config.php file to point to your database. Open the ./config.php file: vi /var/www/html/instance_name/config.php Locate and update the dbconfig array with the information appropriate for your MySQL server as follows: 'dbconfig' => array (
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_Sugar_Cloud_to_On-Site/index.html
85627b082c76-2
'dbconfig' => array ( 'db_host_name' => 'localhost', 'db_host_instance' => 'SQLEXPRESS', 'db_user_name' => 'mysql_username', 'db_password' => 'mysql_password', 'db_name' => 'instance_name', 'db_type' => 'mysql', 'db_port' => '', 'db_manager' => 'MysqliManager', ), Edit the config.php file and modify the following parameters: site_url should be the URL of the instance on your server (e.g. https://www.mysugarinstance.com) host_name should be the URL of the instance without the https protocol (e.g. www.mysugarinstance.com) Modify the .htaccess file in the root directory of the instance. Remove the following lines if they exist in the file: #Added by operations to force SSL RewriteEngine On RewriteCond %{QUERY_STRING} !^entryPoint=WebToLeadCapture RewriteCond %{HTTP:X-SSL-CLUSTER} !^od2$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] If your on-site deployment does not reside in the root of your domain (e.g. https://www.example.com/mysugar/), change the following line from: RewriteBase / to: RewriteBase /mysugar/ If you are migrating permanently to an on-site deployment, there are additional modifications that should be made to ensure full functionality for your instance of Sugar.To restore the ability to perform upgrades, open the ./config.php file and remove the following line: 'disable_uw_upload' => true,
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_Sugar_Cloud_to_On-Site/index.html
85627b082c76-3
To display the full-text search configuration options under Admin > Search, open the ./config.php file and remove the following line: 'hide_full_text_engine_config' => true, To display the Sugar log settings under Admin > System Settings, open the ./config.php file and remove the following line: 'logger_visible' => false, To bypass security checks when installing packages via Admin > Module Loader, open the ./config.php file and change the following line from:'packageScan' => true, to: 'packageScan' => false, To ensure full-text search functions properly, open the ./config.php file and modify the following lines to point to your ElasticSearch configuration: 'full_text_engine' => array ( 'Elastic' => array ( 'host' => '<your_elastic_search_host>', 'port' => '<your_elastic_search_port>', ), ), Disable the SugarCloud Insights service as this is only available for SugarCloud instances. Open the ./config.php file and change 'enabled' => true, to 'enabled' => false, in the following array:'cloud_insight' => array ( 'enabled' => true, 'url' => 'https://sugarcloud-insights.service.sugarcrm.com', 'key' => '<insights key>', ), Finally, please navigate to Admin > Repair and perform a "Quick Repair and Rebuild" to clear all cached elements from the SugarCloud instance. You should now have a working version of your SugarCloud instance accessible from your local server. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_Sugar_Cloud_to_On-Site/index.html
2f081e2510ca-0
Migrating From On-Site to SugarCloud Overview The following article describes the process of migrating an on-site deployment to the SugarCloud environment. Prerequisites A few requirements must be met before an instance can be migrated to the SugarCloud environment: The on-site deployment must be running MySQL. If you are using SQL Server or Oracle, you will need to speak with your Sugar Customer Advocate about data migration options. The instance must be updated to a supported version of Sugar. Refer to the Managing Your Sugar Subscription article for information on determining your Sugar version. Once identified, you can check your version against our Supported Versions. Migration Once the above requirements have been met you are ready to migrate. Case Portal Inform Sugar Support of your intention to migrate by opening a support case. They will provide you with an FTP site and a set of credentials so you can transfer your instance. Sugar Support will expect you to provide two files. One file will be an archive (zip, tar, etc.) containing all the files and folders of your Sugar instance. The second file will be an export of your SQL database; it is a good idea to archive the resulting SQL export as well. Files and Folders You should be aware of the location of your Sugar instance on your on-site server. If you do not, you can locate the path to your instance by navigating to Admin > Schedulers. Once there, you should see something similar to this: To Set Up Crontab Note: In order to run Sugar Schedulers, add the following line to the crontab file: * * * * * cd <path to sugar instance>; php -f cron.php > /dev/null 2>&1
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_On-Site_to_On-Demand/index.html
2f081e2510ca-1
Now that you have located the path to your Sugar instance, archive the entire contents of the Sugar root directory using the archive utility of your choice (zip, tar, WinZip, WinRar, 7zip, etc.). The Sugar root directory is the directory that contains the files config.php, cron.php, sugarcrm.log, and the folders custom, cache, and modules among others. Database The following describes how to export a MySQL database using the command line utility "mysqldump". If you prefer, you may choose to use a tool such as phpMyAdmin to export your database. The command to export a MySQL database is: mysqldump -h localhost -u [MySQL user, e.g. root] -p[database password] [name of the database] > backup.sql If you do not know the host, username, password, or database name you may refer to the "config.php" file of your Sugar instance. The "dbconfig" array in the "config.php" file contains all the required information. The example above showed the following "dbconfig" array: 'dbconfig' => array ( 'db_host_name' => 'localhost', 'db_host_instance' => 'SQLEXPRESS', 'db_user_name' => 'sugarcrm', 'db_password' => 'MyP@ssword', 'db_name' => 'sugarcrm', 'db_type' => 'mysql', ), Using this information we can rewrite the command: mysqldump -h localhost -u sugarcrm -pMyP@ssword sugarcrm > backup.sql Upload Finally, upload the two files to the FTP site provided by the Sugar Support team. The instance will be deployed to the SugarCloud environment and a URL to the instance will be provided to you.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_On-Site_to_On-Demand/index.html
2f081e2510ca-2
Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Migration/Migrating_From_On-Site_to_On-Demand/index.html
7f987902cd37-0
Web Services Overview Web Services allow for communication between different applications and platforms. Sugar currently supports REST and SOAP APIs. The following sections will outline how to interact with the APIs and what versions of the API we recommend for use. Versioning API versioning is the process of creating a new set of API endpoints for new functionality while leaving pre-existing endpoints available for third-party applications and integrations to continue using. This helps to extend the application in an upgrade-safe manner. Quick Reference When working with the Web Service API, you should be using the latest REST API specific to your release. A quick reference of this can be found below: Release1 REST Version REST URL SOAP Version2 SOAP URL 13.0.x v11.20 /rest/v11_20/ v4.1 /service/v4_1/soap.php 12.3.x v11.19 /rest/v11_19/ v4.1 /service/v4_1/soap.php 12.2.x v11.18 /rest/v11_18/ v4.1 /service/v4_1/soap.php 12.1.x v11.17 /rest/v11_17/ v4.1 /service/v4_1/soap.php 12.0.x v11.16 /rest/v11_16/ v4.1 /service/v4_1/soap.php 11.3.x v11.15 /rest/v11_15/ v4.1 /service/v4_1/soap.php 11.2.x v11.14 /rest/v11_14/ v4.1 /service/v4_1/soap.php 11.1.x v11.13 /rest/v11_13/ v4.1 /service/v4_1/soap.php 11.0.x
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/index.html
7f987902cd37-1
v4.1 /service/v4_1/soap.php 11.0.x v11.12 /rest/v11_12/ v4.1 /service/v4_1/soap.php 10.3.x v11.11 /rest/v11_11/ v4.1 /service/v4_1/soap.php 10.2.x v11.10 /rest/v11_10/ v4.1 /service/v4_1/soap.php 10.1.x v11.9 /rest/v11_9/ v4.1 /service/v4_1/soap.php 10.0.x v11.8 /rest/v11_8/ v4.1 /service/v4_1/soap.php 9.3.x v11.7 /rest/v11_7/ v4.1 /service/v4_1/soap.php 9.2.x v11.6 /rest/v11_6/ v4.1 /service/v4_1/soap.php 9.1.x v11.5 /rest/v11_5/ v4.1 /service/v4_1/soap.php 9.0.x v11.4 /rest/v11_4/ v4.1 /service/v4_1/soap.php 8.3.x v11.4 /rest/v11_4/ v4.1 /service/v4_1/soap.php 8.2.x v11.3 /rest/v11_3/ v4.1 /service/v4_1/soap.php 8.1.x v11.2 /rest/v11_2/ v4.1 /service/v4_1/soap.php 8.0.x v11.1
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/index.html
7f987902cd37-2
/service/v4_1/soap.php 8.0.x v11.1 /rest/v11_1/ v4.1 /service/v4_1/soap.php 7.11.x v11 /rest/v11/ v4.1 /service/v4_1/soap.php 7.10.x v11 /rest/v11/ v4.1 /service/v4_1/soap.php 7.9.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php 7.8.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php 7.7.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php 6.5.x v4.1 /service/v4_1/rest.php v4.1 /service/v4_1/soap.php 1 Some of the releases in this table may no longer be officially-supported Sugar versions, but we have included them for archival purposes. For more information, please refer to the Supported Versions resource page. 2 As of Sugar 7.0, SOAP support is no longer offered with the new APIs. The legacy APIs will remain accessible in the product, however, any existing integrations should be updated to use the latest REST endpoints. TopicsREST APIv10 - v11.20 API documentation.Legacy APIv1 - v4.1 API documentation. Last modified: 2023-04-05 00:07:43
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/index.html
3ec5f94059b9-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. Legacy API Overview v1 - v4.1 API documentation. SOAP VS REST There are significant differences between how the legacy REST and SOAP protocols function on an implementation level (e.g. Performance, response size, etc). Deciding which protocol to use is up to the individual developer and is beyond the scope of this guide. Starting in SugarCRM version 6.2.0, there are some deviations between the protocols with the v4 API. There are additional core calls that are only made available through the REST protocol. They are listed below: get_module_layout get_module_layout_md5 get_quotes_pdf method get_report_pdf method snip_import_emails snip_update_contacts job_queue_cycle job_queue_next job_queue_run oauth_access method oauth_access_token oauth_request_token REST REST stands for 'Representational State Transfer'. This protocol is used by Sugar to exchange information both internally and externally. How do I access the REST service? The legacy REST services in SugarCRM and be found by navigating to: http://{site url)/service/{version}/rest.php Where 'site url' is the URL of your Sugar instance and 'version' is the latest version of the API specific to your release of Sugar. You can find out more about versioning in the Web Services documentation. Input / Output Datatypes The default input / output datatype for REST is JSON / PHP serialize. These datatype files, SugarRestJSON.php and SugarRestSerialize.php, are in: ./service/core/REST/ Defining your own Datatypes You can also define you own datatype. To do this, you need to create a new file such as: ./service/core/REST/SugarRest<CustomDataType>.php
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/index.html
3ec5f94059b9-1
./service/core/REST/SugarRest<CustomDataType>.php Next, you will need to override generateResponse() and serve() functions. The Serve function decodes or unserializes the appropriate datatype based on the input type; the generateResponse function encodes or serializes it based on the output type. See service/test.html for more examples on usage. In this file, the getRequestData function, which generates URL with json, is both the input_type and the response_type. That is, the request data from the JavaScript to the server is JSON and response data from server is also JSON. You can mix and match any datatype as input and output. For example, you can have JSON as the input_type and serialize as the response_type based on your application's requirements. REST Failure Response If a call failure should occur, the result will be as shown below: Name Type Description name String Error message. number Integer Error number. description String Description of error. SOAP SOAP stands for 'Simple Object Access Protocol'. SOAP is a simple XML-based protocol that is used to allow applications to exchange information. How do I access the SOAP service? The legacy SOAP service in SugarCRM and be found by navigating to: http://{sugar_url)/service/{version}/soap.php Where 'sugar_url' is the url of your Sugar instance and 'version' is the latest version of the API specific to your release of Sugar. You can find out more about versioning in the section titled 'API: Versioning'. The default WSDL is formatted as rpc/encoded. WS-I 1.0 Compliancy Sugar supports generating a URL that is WS-I compliant. When accessing the soap entry point, you can access the WSDL at: http://{sugar_url)/service/{version}/soap.php?wsdl
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/index.html
3ec5f94059b9-2
http://{sugar_url)/service/{version}/soap.php?wsdl By default, the WSDL is formatted as rpc/encoded, however, this can be changed by specifying a 'style' and 'use' url-paramater. An example of this is: http://{sugar_url)/service/{version}/soap.php?wsdl&style=rpc&use=literal URL Parameters style rpc use encoded literal Validation This WSDL (rpc/literal) was successfully verified against Apache CXF 2.2. SOAP Failure Response If a call failure should occur, the result will be as shown below: Name Type Description faultcode Integer Fault ID. faultactor String Provides information about what caused the fault to happen. faultstring String Fault Message. detail String Description of fault. TopicsWhat is NuSOAP?NuSOAP is a SOAP Toolkit for PHP that doesn't require PHP extensions.MethodsWeb Service Method Calls.REST Release NotesLists changes between the different versions of the REST API.SOAP Release NotesLists changes between the different versions of the SOAP API.SugarHttpClientThe SugarHttpClient class is used to make REST calls. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/index.html
c7615e1b9eb4-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. What is NuSOAP? Overview NuSOAP is a SOAP Toolkit for PHP that doesn't require PHP extensions. Where Can I Get It? NuSOAP can be downloaded from http://nusoap.sourceforge.net How Do I Use It? After you have downloaded NuSOAP, you will need to extract the zip file contents to a storage directory. Once extracted, you will reference "lib/nusoap.php" in your PHP SOAP application. Example <?php //require NuSOAP require_once("./lib/nusoap.php"); //retrieve WSDL $client = new nusoap_client("http://{site_url}/service/v4/soap.php?wsdl", 'wsdl');     Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/What_is_NuSOAP/index.html
0f06d7361192-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. SOAP Release Notes Overview Lists changes between the different versions of the SOAP API. Release Notes v4_1 get_modified_relationships method was added. get_relationships had the parameter $limit added. get_relationships had the parameter $offset added. v4 search_by_module had the parameter $favorites added. v3_1 get_entries had the parameter $track_view added. get_entry had the parameter $track_view added. get_entry_list had the parameter $favorites added. search_by_module had the parameter $unified_search_only added. v3 get_available_modules had the parameter $filter added. get_last_viewed method was added. get_module_fields_md5 method was added. get_relationships had the parameter $order_by added. get_upcoming_activities method was added. search_by_module had the parameter $assigned_user_id added. search_by_module had the parameter $select_fields added. v2_1 get_entry_list method logic was modified. get_report_entries method logic was modified. v2 contact_by_email method was removed. create_account method was removed. create_case method was removed. create_contact method was removed. create_lead method was removed. create_opportunity method was removed. create_session method was removed. end_session method was removed. get_attendee_list method was removed. get_contact_relationships method was removed. get_disc_client_file_list method was removed. get_document_revision return type was changed from return_document_revision to new_return_document_revision. get_encoded_file method was removed. get_encoded_portal_zip_file method was removed. get_encoded_zip_file method was removed. get_entries had the parameter $link_name_to_fields_array added.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SOAP_Release_Notes/index.html
0f06d7361192-1
get_entries had the parameter $link_name_to_fields_array added. get_entries return type was changed from get_entry_result to get_entry_result_version2. get_entry had the parameter $link_name_to_fields_array added. get_entry return type was changed from get_entry_result to get_entry_result_version2. get_entry_list had the parameter $link_name_to_fields_array added. get_entry_list return type was changed from get_entry_list_result to get_entry_list_result_version2. get_gmt_time method was removed. get_mailmerge_document method was removed. get_mailmerge_document2 method was removed. get_modified_entries method was removed. get_module_fields had the parameter $fields added. get_module_fields return type was changed from module_fields to new_module_fields. get_note_attachment return type was changed from return_note_attachment to new_return_note_attachment. get_quick_sync_data method was removed. get_related_notes method was removed. get_relationships had the parameter $link_field_name added. get_relationships had the parameter $related_fields added. get_relationships had the parameter $related_module removed. get_relationships had the parameter $related_module_link_name_to_fields_array added. get_relationships return type was changed from get_relationships_result to get_entry_result_version2. get_report_entries method was added. get_required_upgrades method was removed. get_server_info method was added. get_server_time method was removed. get_server_version method was removed. get_sugar_flavor method was removed. get_system_status method was removed. get_unique_system_id method was removed. is_loopback method was removed. is_user_admin method was removed. login had the parameter $name_value_list added. login return type was changed from set_entry_result to entry_value. logout return type was changed from error_value to void.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SOAP_Release_Notes/index.html
0f06d7361192-2
logout return type was changed from error_value to void. offline_client_available method was removed. relate_note_to_module method was removed. search method was removed. search_by_module had the parameter $password removed. search_by_module had the parameter $session added. search_by_module had the parameter $user_name removed. search_by_module return type was changed from get_entry_list_result to return_search_result. set_campaign_merge return type was changed from error_value to void. set_document_revision return type was changed from set_entry_result to new_set_entry_result. set_entries return type was changed from set_entries_result to new_set_entries_result. set_entries_details method was removed. set_entry return type was changed from set_entry_result to new_set_entry_result. set_note_attachment had the parameter $note type change from note_attachment to new_note_attachment. set_note_attachment return type was changed from set_entry_result to new_set_entry_result. set_relationship had the parameter $delete added. set_relationship had the parameter $link_field_name added. set_relationship had the parameter $module_id added. set_relationship had the parameter $module_name added. set_relationship had the parameter $name_value_list added. set_relationship had the parameter $related_ids added. set_relationship had the parameter $set_relationship_value removed. set_relationship return type was changed from error_value to new_set_relationship_list_result. set_relationships had the parameter $delete_array added. set_relationships had the parameter $link_field_names added. set_relationships had the parameter $module_ids added. set_relationships had the parameter $module_names added. set_relationships had the parameter $name_value_lists added. set_relationships had the parameter $related_ids added. set_relationships had the parameter $set_relationship_list removed.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SOAP_Release_Notes/index.html
0f06d7361192-3
set_relationships had the parameter $set_relationship_list removed. set_relationships return type was changed from set_relationship_list_result to new_set_relationship_list_result. sudo_user method was removed. sync_get_entries method was removed. sync_get_modified_relationships method was removed. sync_get_relationships method was removed. sync_set_entries method was removed. sync_set_relationships method was removed. track_email method was removed. update_portal_user method was removed. user_list method was removed. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SOAP_Release_Notes/index.html
9d821780b753-0
SugarHttpClient Overview The SugarHttpClient class is used to make REST calls. The SugarHttpClient Class The SugarHttpClient class is located in 'include/SugarHttpClient.php'. It contains a callRest() method that will allow you to post a request to a REST service via cURL without having to worry about the overhead or the restrictions on the file_get_contents() method when doing outbound webservice calls. Making a Request <?php // specify the REST web service to interact with $url = 'http://{sugar_url}/service/v4_1/rest.php'; // Open a SugarHttpClient session for making the call require_once('include/SugarHttpClient.php'); $client = new SugarHttpClient; // Set the POST arguments to pass to the Sugar server $parameters = array( 'user_auth' => array( 'user_name' => 'username', 'password' => md5('password'), ), ); $json = json_encode($parameters); $postArgs = array( 'method' => 'login', 'input_type' => 'JSON', 'response_type' => 'JSON', 'rest_data' => $json, ); $postArgs = http_build_query($postArgs); // Make the REST call, returning the result $response = $client->callRest($url, $postArgs); if ( $response === false ) { die("Request failed.\n"); } // Convert the result from JSON format to a PHP array $result = json_decode($response); if ( !is_object($result) ) { die("Error handling result.\n"); } if ( !isset($result->id) ) {
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SugarHttpClient/index.html
9d821780b753-1
} if ( !isset($result->id) ) { die("Error: {$result->name} - {$result->description}\n."); } // Get the session id $sessionId = $result->id; ?> Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/SugarHttpClient/index.html
3993405d48ef-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. REST Release Notes Overview Lists changes between the different versions of the REST API. Release Notes v4_1 get_modified_relationships method was added. get_relationships had the parameter $limit added. get_relationships had the parameter $offset added. v4 get_entries had the parameter $track_view removed. job_queue_cycle method was added. job_queue_next method was added. job_queue_run method was added. oauth_access method was added. oauth_access_token method was added. oauth_request_token method was added. search_by_module had the parameter $favorites added. snip_import_emails method was added. snip_update_contacts method was added. v3_1 get_entries had the parameter $track_view added. get_entry had the parameter $track_view added. get_entry_list had the parameter $favorites added. get_language_definition method was added. get_module_layout had the parameter $acl_check added. get_module_layout_md5 had the parameter $acl_check added. get_quotes_pdf method was added. get_report_pdf method was added. search_by_module had the parameter $unified_search_only added. set_entry had the parameter $track_view added. v3 get_available_modules had the parameter $filter added. get_last_viewed method was added. get_module_fields_md5 method was added. get_module_layout method was added. get_module_layout_md5 method was added. get_relationships had the parameter $order_by added. get_upcoming_activities method was added. search_by_module had the parameter $assigned_user_id added. search_by_module had the parameter $select_fields added. v2_1 get_entry_list method logic was modified. get_report_entries method logic was modified.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/REST_Release_Notes/index.html
3993405d48ef-1
get_entry_list method logic was modified. get_report_entries method logic was modified. md5 method was removed. v2 (REST API was introduced into SugarCRM) get_available_modules method was added. get_document_revision method was added. get_entries method was added. get_entries_count method was added. get_entry method was added. get_entry_list method was added. get_module_fields method was added. get_note_attachment method was added. get_relationships method was added. get_report_entries method was added. get_server_info method was added. get_user_id method was added. get_user_team_id method was added. login method was added. logout method was added. md5 method was added. seamless_login method was added. search_by_module method was added. set_campaign_merge method was added. set_document_revision method was added. set_entries method was added. set_entry method was added. set_note_attachment method was added. set_relationship method was added. set_relationships method was added.SOAP Release Notes Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/REST_Release_Notes/index.html
8e06eb137692-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. Methods Web Service Method Calls.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/index.html
8e06eb137692-1
Topicsget_available_modulesRetrieves a list of available modules in the system.get_document_revisionRetrieves a specific document revision.get_entriesRetrieves a list of beans based on specified record IDs.get_entries_countRetrieves a list of beans based on query specifications.get_entryRetrieves a single bean based on record ID.get_entry_listRetrieves a list of beans based on query specifications.get_language_definitionRetrieves the language label strings for the specified modules.get_last_viewedRetrieves a list of recently viewed records by module for the current user.get_modified_relationshipsRetrieves a list of modified relationships between a specific date range. Helps facilitate sync operations for users.get_module_fieldsRetrieves the list of field vardefs for a specific module.get_module_fields_md5Retrieves the MD5 hash of the vardefs for the specified modules.get_module_layoutRetrieves the layout metadata for a given module given a specific type and view.get_module_layout_md5Retrieves the MD5 hash value for a layout given a specific module, type and view.get_note_attachmentRetrieves an attachment associated with a specific note record.get_quotes_pdfGenerates a quote PDF for a specific quote.get_relationshipsRetrieves a specific relationship link for a specified record.get_report_entriesRetrieves a list of report entries based on specified record IDs.get_report_pdfGenerates a PDF for a specific report.get_server_infoRetrieves info about the SugarCRM instance.get_upcoming_activitiesRetrieves a list of upcoming activities for the current user.get_user_idRetrieves the id of the user currently logged in.get_user_team_idRetrieves the ID of the default team of the user who is logged into the current session.job_queue_cycleRuns through the scheduler cleanup process and cycles the scheduler jobs.job_queue_nextRetrieves the next job from the job queue and marks it as 'In Progress'.job_queue_runRuns the specified job.loginLogs a user into the SugarCRM
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/index.html
8e06eb137692-2
as 'In Progress'.job_queue_runRuns the specified job.loginLogs a user into the SugarCRM application.logoutLogs a user out of the SugarCRM application.oauth_accessRetrieves the OAuth access token.seamless_loginVerifies that a session is authenticated.search_by_moduleSearches modules for a string and returns matched records.set_campaign_mergeHandles campaign log entry creation for mail-merge activity given a specified campaign.set_document_revisionCreates a new document revision for a specific document record.set_entriesCreate or update a list of records.set_entryCreates or updates a specific record.set_note_attachmentCreates an attachment and associated it to a specific note record.set_relationshipSets relationships between two records. You can relate multiple records to a single record using this.set_relationshipsSets multiple relationships between mulitiple record sets.snip_import_emailsUsed to imports an email record from the SNIP archiving service.snip_update_contactsRetrieves new contact emails since a timestamp for the current user.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/index.html
8e06eb137692-3
Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/index.html
943e455b3a15-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_module_layout_md5 Overview Retrieves the MD5 hash value for a layout given a specific module, type and view. Available APIs REST Definition get_module_layout_md5(session, modules, types, views, acl_check) Parameters Name Type Description session String Session ID returned by a previous login call. modules Array The list of modules to retrieve layouts for. types Array The types of views requested. Current supported types are 'default' (for application) and 'wireless'. views Array The views requested. Current supported types are 'edit', 'detail', 'list', and 'subpanel'. acl_check Boolean Whether or not to check for ACL access. Result Name Type Description result Array The call result. Contains a list of modules. result[][$type] Array The list of types requested. result[][$view] String The list of MD5 layout view hashes requested. Change Log Version Change v3_1 Added acl_check parameter. v3 Added get_module_layout_md5 method. Examples PHP $get_module_layout_md5_parameters = array( //Session id 'session' => $session_id, //The list of modules 'modules' => array( 'Accounts' ), //The types of views requested 'types' => array( 'default', ), //The views requested 'views' => array( 'edit' ), //Whether or not to check for ACL access 'acl_check' => false, );
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_layout_md5/index.html
943e455b3a15-1
'acl_check' => false, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_layout_md5/index.html
2aff22bc915c-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. job_queue_run Overview Runs the specified job. Available APIs REST Definition job_queue_run(session, jobid, clientid) Parameters Name Type Description session String Session ID returned by a previous login call. jobid String The ID of the job to run. clientid String The client id calling the application. This parameter is of your choosing for the calling application. Result Name Type Description result Array The call result. result.results Boolean The result of the job run. result.message String This is only returned if a failure occurs. Change Log Version Change v4 Added job_queue_run method. Examples PHP $job_queue_run_parameters = array( //Session id 'session' => $session_id, //The ID of the job to run. 'jobid' => 'd141efd3-d2c7-8a9c-9c02-50c11b491f16', //The ID of the calling application. 'clientid' => 'MyAppID', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/job_queue_run/index.html
f65766cf8bb3-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_module_fields_md5 Overview Retrieves the MD5 hash of the vardefs for the specified modules. Available APIs SOAP REST Definition get_module_fields_md5(session, module_names) Parameters Name Type Description session String Session ID returned by a previous login call. module_names select_fields | Array The list of modules to retrieve MD5 hashes for. Result Name Type Description result md5_results | Array The call result. Contains a list of module field hashes. Order is based on the module_names parameter. Change Log Version Change Examples PHP $get_module_fields_md5_parameters = array( //Session id "session" => $session_id, //The name of the modules to retrieve field hashes for 'module_names' => array( 'Contacts', 'Accounts' ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_fields_md5/index.html
d146ac1f1abb-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_user_team_id Overview Retrieves the ID of the default team of the user who is logged into the current session. Available APIs SOAP REST Definition get_user_team_id(session) Parameters Name Type Description session String Session ID returned by a previous login call. Result Name Type Description default_team_id Integer The ID of the current users default ream Change Log Version Change v2 Added get_user_team_id method. Examples PHP $get_user_team_id_parameters = array( //Session id "session" => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_user_team_id/index.html
0c9c1270bb2b-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_user_id Overview Retrieves the id of the user currently logged in. Available APIs SOAP REST Definition get_user_id(session) Parameters Name Type Description session String Session ID returned by a previous login call. Result Name Type Description id String The users ID. Change Log Version Change Examples PHP $get_user_id_parameters = array( //Session id "session" => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_user_id/index.html
27a8c110e12f-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. search_by_module Overview Searches modules for a string and returns matched records. Available APIs SOAP REST Definition search_by_module(session, search_string, modules, offset, max_results, assigned_user_id, select_fields, unified_search_only, favorites) Parameters Name Type Description session String Session ID returned by a previous login call. search_string String The string to search for. modules Integer The list of modules to query. offset Integer The record offset from which to start. max_results Integer The maximum number of records to return. assigned_user_id String Filters records by the assigned user ID. Leave this empty if no filter should be applied. select_fields select_fields | Array An array of fields to return. If empty the default return fields will be from the active listviewdefs. unified_search_only Boolean If the search is only against modules participating in the unified search. favorites Boolean If only records marked as favorites should be returned. Result Name Type Description result return_search_result | Array Call result. result.entry_list Array The count of records in paged result. result.entry_list[].name String The .name of the module result.entry_list[].records Array A list of name_value lists for each record matched. Change Log Version Change v3_1 Added unified_search_only parameter. Examples PHP $search_by_module_parameters = array( //Session id "session" => $session_id, //The string to search for. 'search_string' => 'example text', //The list of modules to query. 'modules' => array(
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/search_by_module/index.html
27a8c110e12f-1
//The list of modules to query. 'modules' => array( 'Accounts', ), //The record offset from which to start. 'offset' => 0, //The maximum number of records to return. 'max_results' => 100, //Filters records by the assigned user ID. //Leave this empty if no filter should be applied. 'assigned_user_id' => '', //An array of fields to return. //If empty the default return fields will be from the active listviewdefs. 'select_fields' => array( 'id', 'name', ), //If the search is only search modules participating in the unified search. 'unified_search_only' => false, //If only records marked as favorites should be returned. 'favorites' => false ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/search_by_module/index.html
0831b9c4992e-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_available_modules Overview Retrieves a list of available modules in the system. Available APIs SOAP REST Definition get_available_modules(session, filter) Parameters Name Type Description session String Session ID returned by a previous login call. filter String String to filter the modules with. Possible values are 'default', 'mobile', 'all'. Result Name Type Description result new_module_fields | Array The call result. result.modules Array The list of avaialble modules. result.modules[].module_key String The modules key. result.modules[].module_label String The display label for the module. result.modules[].favorite_enabled String Whether favorites are enabled for the module. result.modules[].acls Array The ACL list for the module Change Log Version Change v3 Added filter parameter. Accepts the values 'default', 'mobile', 'all'. Examples PHP $get_available_modules_parameters = array( //Session id "session" => $session_id, //Module filter. Possible values are 'default', 'mobile', 'all'. "filter" => 'all', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_available_modules/index.html
c3fee7b73ab3-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_relationships Overview Sets multiple relationships between mulitiple record sets. Available APIs SOAP REST Definition set_relationships(session, module_names, module_ids, link_field_names, related_ids, name_value_lists, delete_array) Parameters Name Type Description session String Session ID returned by a previous login call. module_names select_fields | Array The list of modules from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. module_ids select_fields | Array The list of IDs for the specified module records. link_field_names select_fields | Array The list of link names for the related modules. related_ids new_set_relationhip_ids | Array The list of related record IDs you are relating. name_value_lists name_value_lists | Array An array of arrays specifying relationship fields to populate. An example of this is contact_role between Opportunities and Contacts. delete_array deleted_array | Array An array determining whether the relationships are being created or deleted. 0:create, 1:delete Result Name Type Description result new_set_relationship_list_result | Array The call result. result.created Integer The number of relationships created. result.failed Integer Determines whether or not the relationship failed. This is normally thrown when the parameters module_name or link_field_name are incorrect. result.deleted Integer The number of relationships deleted. Change Log Version Change v2 Removed set_relationship_value parameter. v2 Added module_names parameter. v2 Added module_ids parameter. v2 Added link_field_names parameter. v2 Added related_ids parameter. v2 Added name_value_lists parameter. v2
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_relationships/index.html
c3fee7b73ab3-1
Added related_ids parameter. v2 Added name_value_lists parameter. v2 Added delete_array parameter. v2 Return type was changed from set_relationship_list_result to new_set_relationship_list_result. Examples PHP $set_relationships_parameters = array( //session id 'session' => $session_id, //The name of the modules from which to relate records. 'module_names' => array( 'Opportunities', 'Accounts', ), //The IDs of the specified module beans. 'module_ids' => array( '15e79b92-5025-827f-0784-50aa578270d8', //Opportunity ID '27035f04-f6ec-492d-b89e-50aa57f5247f' //Account ID ), //The relationship names of the linked fields from which to relate records. 'link_field_names' => array( 'contacts', //Contacts link field to Opportunities 'leads' //Leads link field to Accounts ), //The lists of record ids to relate 'related_ids' => array( //Contact IDs array( '19b8799e-64ae-9502-588c-50aa575454c9' ), //Lead IDs array( '16d8d519-5f56-0984-2092-50aa576a7333', '15ae07eb-63f0-dbac-6e4c-50aa57c5a609' ), ), //Sets the value for relationship based fields 'name_value_lists' => array( //Opportunity-Contact relationship fields
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_relationships/index.html
c3fee7b73ab3-2
'name_value_lists' => array( //Opportunity-Contact relationship fields array( array( 'name' => 'contact_role', 'value' => 'Other' ), ), //Account-Lead relationship fields array(), ), //Whether or not to delete the relationships. 0:create, 1:delete 'delete_array'=> array( 0, //Opportunity-Contact 0 //Account-Lead ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_relationships/index.html
5ac5555701f8-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_server_info Overview Retrieves info about the SugarCRM instance. Available APIs SOAP REST Definition get_server_info() Parameters Name Type Description null null No parameters available. Result Name Type Description result get_server_info_result | Array The call result. result.flavor String The flavor of the instance. result.version String The version of the instance. result.gmt_time String The GMT time of the server. Change Log Version Change v2 Method get_server_info was added to replace get_server_time, get_server_version and get_sugar_flavor. v2 Method get_server_time was removed. v2 Method get_server_version was removed. v2 Method get_sugar_flavor was removed. Examples PHP //this method does not have any parameters $get_server_info_parameters = array(); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_server_info/index.html
40b4182dd9d0-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. seamless_login Overview Verifies that a session is authenticated. Available APIs SOAP REST Definition seamless_login(session) Parameters Name Type Description session String Session ID returned by a previous login call. Result Name Type Description result Integer Returns 1 if the session is authenticated. Otherwise 0 will be returned. Change Log Version Change Considerations If you are attempting to log a user into SugarCRM seamlessly, you can do this by passing the validated session_id in the url. An example is shown below: http://{site_url}/index.php?module=Home&action=index&MSID={session_id} Examples PHP $seamless_login_parameters = array( //Session id "session" => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/seamless_login/index.html
a1910e80fe92-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_report_pdf Overview Generates a PDF for a specific report. Available APIs REST Definition get_report_pdf(session, report_id) Parameters Name Type Description session String Session ID returned by a previous login call. report_id String The ID of the report record to generate the PDF for. Result Name Type Description result Array The call result. result.file_contents String The binary contents of the PDF file. Change Log Version Change v3_1 Added get_report_pdf method. Examples PHP $get_report_pdf_parameters = array( //Session id 'session' => $session_id, //The report to generate the pdf for. 'report_id' => '68ca4de9-7486-72e1-1a56-50aa5757aaab', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_report_pdf/index.html
95b5c598661f-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_upcoming_activities Overview Retrieves a list of upcoming activities for the current user. Available APIs SOAP REST Definition get_upcoming_activities(session) Parameters Name Type Description session String Session ID returned by a previous login call. Result Name Type Description result upcoming_activities_list | Array The call result. Contains a list of upcoming activity records. result[].id Integer The record ID. result[].module String The activity module. result[].date_due String The date the activity is due. result[].summary String The summary of the activity. Change Log Version Change Examples PHP $get_upcoming_activities_parameters = array( //Session id "session" => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_upcoming_activities/index.html
033d0bd70c7c-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_relationship Overview Sets relationships between two records. You can relate multiple records to a single record using this. Available APIs SOAP REST Definition set_relationship(session, module_name, module_id, link_field_name, related_ids, name_value_list, delete) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. module_id String The ID of the specified module record. link_field_name String The name of the link field for the related module. related_ids select_fields | Array The list of related record IDs you are relating name_value_list name_value_list | Array An array specifying relationship fields to populate. An example of this is contact_role between Opportunities and Contacts. delete Integer Determines whether the relationship is being created or deleted. 0:create, 1:delete Result Name Type Description result new_set_relationship_list_result | Array The call result result.created Integer The number of relationships created. result.failed Integer Determines whether or not the relationship failed. This is normally thrown when the parameters module_name or link_field_name are incorrect. result.deleted Integer The number of relationships deleted. Change Log Version Change v2 Removed set_relationship_value parameter. v2 Added module_name parameter. v2 Added module_id parameter. v2 Added link_field_name parameter. v2 Added related_ids parameter. v2 Added name_value_list parameter. v2 Added delete parameter. v2
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_relationship/index.html
033d0bd70c7c-1
Added name_value_list parameter. v2 Added delete parameter. v2 Return type was changed from error_value to new_set_relationship_list_result. Examples PHP $set_relationship_parameters = array( //session id 'session' => $session_id, //The name of the module. 'module_name' => 'Opportunities', //The ID of the specified module bean. 'module_id' => '15e79b92-5025-827f-0784-50aa578270d8', //The relationship name of the linked field from which to relate records. 'link_field_name' => 'contacts', //The list of record ids to relate 'related_ids' => array( '19b8799e-64ae-9502-588c-50aa575454c9', ), //Sets the value for relationship based fields 'name_value_list' => array( array( 'name' => 'contact_role', 'value' => 'Other' ) ), //Whether or not to delete the relationship. 0:create, 1:delete 'delete'=> 0, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_relationship/index.html
f5f9c35a82da-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_entries Overview Create or update a list of records. Available APIs SOAP REST Definition set_entries(session, module_name, name_value_lists) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. name_value_lists name_value_lists | Array The an array of name/value lists containing the record attributes. Result Name Type Description result new_set_entries_result | Array The call result. result.ids Array The list of record IDs that were created or updated Change Log Version Change v2 Return type was changed from set_entry_result to new_set_entries_result. Considerations To update an existing record, you will need to specify 'id' for the name_value_list item in the name_value_lists parameter. To create a new record with a specific ID, you will need to set 'new_with_id' in the name_value_list item in the name_value_lists parameter. Examples PHP $set_entries_parameters = array( //Session id "session" => $session_id, //The name of the module from which to retrieve records. "module_name" => "Accounts", //Record attributes "name_value_lists" => array( array( //to update a record /* array( "name" => "id", "value" => "da0b107d-cfbc-cb08-4f90-50b7b9cb9ad7" ), */
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_entries/index.html
f5f9c35a82da-1
), */ //to create a new record with a specific ID /* array( "name" => "new_with_id", "value" => 1 ), */ array( "name" => "name", "value" => "Example Account 1" ), ), array( //to update a record /* array( "name" => "id", "value" => "da0b107d-cfbc-cb08-4f90-50b7b9cb9ad7" ), */ //to create a new record with a specific ID /* array( "name" => "new_with_id", "value" => 1 ), */ array( "name" => "name", "value" => "Example Account 2" ), ), ) ,); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_entries/index.html
82d6b546b5ef-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. job_queue_cycle Overview Runs through the scheduler cleanup process and cycles the scheduler jobs. Available APIs REST Definition job_queue_cycle(session, clientid) Parameters Name Type Description session String Session ID returned by a previous login call. clientid String The client id calling the application. This parameter is of your choosing for the calling application. Result Name Type Description result Array The call result. result.results String The cycle result. Returns 'ok' on success. Change Log Version Change v4 Added job_queue_cycle method. Examples PHP $job_queue_cycle_parameters = array( //Session id 'session' => $session_id, //The ID of the calling application. 'clientid' => 'MyAppID', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/job_queue_cycle/index.html
fc8bc909653e-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. login Overview Logs a user into the SugarCRM application. Available APIs SOAP REST Definition login(user_auth, application_name, name_value_list) Parameters Name Type Description user_auth user_auth | Array Contains the parameters to authenticate a user. user_auth.user_name String The user name of your user user_auth.password String The MD5 hash of the users password. application name String The name of the application logging in. name_value_list name_value_list | Array Sets the name_value pair. The parameter is used to set values for the 'language' and 'notifyonsave' user settings. name_value_list.language String The language for the user. name_value_list.notifyonsave Boolean Alerts users on new record creations when set to true. Result Name Type Description result entry_value | Array The call result result.id String This is the session id required to make other method calls. result.module_name String Returns the 'Users' module. result.name_value_list Array Authenticated user properties. result.name_value_list.user_id String ID of the authenitcated user. result.name_value_list.user_name String Username of the authenticated user. result.name_value_list.user_language String Default language of the authenticated user. result.name_value_list.user_currency_id String Default currency ID of the authenticated user. result.name_value_list.user_is_admin String Admin status of the authenticated user. result.name_value_list.user_default_team_id String Default team of the authenticated user. result.name_value_list.user_default_dateformat String Default date format for the authenticated user. result.name_value_list.user_default_timeformat
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/login/index.html
fc8bc909653e-1
String Default date format for the authenticated user. result.name_value_list.user_default_timeformat String Default time format for the authenticated user. result.name_value_list.user_number_seperator String Number seperator for the authenticated user. result.name_value_list.user_decimal_seperator String Decimal sperator for the authenticated user. result.name_value_list.mobile_max_list_entries String Max list entires for the authenticated user. result.name_value_list.mobile_max_subpanel_entries String Max subpanel entries for the authenticated user. result.name_value_list.user_currency_name String Default currency name for the authenticated user. Change Log Version Change v3_1 Added additional return values to name_value_list. The list now also includes user_number_seperator, user_decimal_seperator, mobile_max_list_entries, mobile_max_subpanel_entries. v3 Added additional return values to name_value_list. The list now also includes user_is_admin, user_default_team_id, user_default_dateformat, user_default_timeformat. v2 Added name_value_list to response. Returns user_id, user_name, user_language, user_currency_id, user_currency_name. v2 Added module_name to response. v2 Removed error from response. v2 Added name_value_list parameter v2 Return type was changed from set_entry_result to entry_value. Examples PHP $login_parameters = array( //user authentication "user_auth" => array( "user_name" => $username, "password" => md5($password), ), //application name "application_name" => "My Application", //name value list for 'language' and 'notifyonsave' "name_value_list" => array( array( 'name' => 'language',
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/login/index.html
fc8bc909653e-2
array( 'name' => 'language', 'value' => 'en_us', ), array( 'name' => 'notifyonsave', 'value' => true ), ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/login/index.html
01a3155c5c24-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_document_revision Overview Creates a new document revision for a specific document record. Available APIs SOAP REST Definition set_document_revision(session, note) Parameters Name Type Description session String Session ID returned by a previous login call. note document_revision | Array The file attachment details note.id String The ID of the note record to associate the attachment to. note.file String The binary contents of the file. note.filename String The file name of the file attachment. note.revision String The revision number Result Name Type Description result new_set_entry_result | array The results from the call. result.id String The ID of the document revision. Change Log Version Change v2 Return type was changed from set_entry_result to new_set_entry_result. Examples PHP $file_contents = file_get_contents("/path/to/example_document.txt"); $set_document_revision_parameters = array( //Session id "session" => $session_id, //The attachment details "note" => array( //The ID of the parent document. 'id' => $document_id, //The binary contents of the file. 'file' => base64_encode($file_contents), //The name of the file 'filename' => 'example_document.txt', //The revision number 'revision' => '1', ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_document_revision/index.html
65afaf653083-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. logout Overview Logs a user out of the SugarCRM application. Available APIs SOAP REST Definition logout(session) Parameters Name Type Description session String Session ID returned by a previous call to login. Result Name Type Description null void No return value. Change Log Version Change v2 Return type was changed from error_value to void. Example PHP $logout_parameters = array( //session id to expire "session" => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/logout/index.html
dc0ca8ceeeb2-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_entry_list Overview Retrieves a list of beans based on query specifications. Available APIs SOAP REST Definition get_entry_list(session, module_name, query, order_by, offset, select_fields, link_name_to_fields_array, max_results, deleted, favorites) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. query String The SQL WHERE clause without the word "where". You should remember to specify the table name for the fields to avoid any ambiguous column errors. order_by String The SQL ORDER BY clause without the phrase "order by". offset Integer The record offset from which to start. select_fields select_fields | Array The list of fields to be returned in the results. Specifying an empty array will return all fields. link_name_to_fields_array link_names_to_fields_array | Array A list of link names and the fields to be returned for each link. max_results Integer The maximum number of results to return. deleted Integer If deleted records should be included in the results. favorites Boolean If only records marked as favorites should be returned. Result Name Type Description result get_entry_result_version2 | Array The call result. result.result_count Integer The total number of records returned in the call. result.total_count Integer The total number of records. resultnext_offset Integer The next offset to retrieve records. result.entry_list Array
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entry_list/index.html
dc0ca8ceeeb2-1
resultnext_offset Integer The next offset to retrieve records. result.entry_list Array The record's name-value pair for the simple datatypes excluding the link field data. If you do not have access to the object, entry_list[].name_value_list will notify you. result.relationship_list Array The records link field data. Change Log Version Change v3_1 Added favorites parameter. v2 Added link_name_to_fields_array parameter. v2 Return type was changed from get_entry_list_result to get_entry_list_result_version2. Examples PHP $get_entry_list_parameters = array( //session id 'session' => $session_id, //The name of the module from which to retrieve records 'module_name' => 'Leads', //The SQL WHERE clause without the word "where". 'query' => "", //The SQL ORDER BY clause without the phrase "order by". 'order_by' => "", //The record offset from which to start. 'offset' => 0, //A list of fields to include in the results. 'select_fields' => array( 'id', 'name', 'title', ), //A list of link names and the fields to be returned for each link name. 'link_name_to_fields_array' => array( array( 'name' => 'email_addresses', 'value' => array( 'email_address', 'opt_out', 'primary_address' ), ), ), //The maximum number of results to return. 'max_results' => 2, //If deleted records should be included in results. 'deleted' => 0,
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entry_list/index.html
dc0ca8ceeeb2-2
'deleted' => 0, //If only records marked as favorites should be returned. 'favorites' => false, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entry_list/index.html
652250f7fa01-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_campaign_merge Overview Handles campaign log entry creation for mail-merge activity given a specified campaign. Available APIs SOAP REST Definition set_campaign_merge(session, targets, campaign_id) Parameters Name Type Description session String Session ID returned by a previous call to login. targets select_fields | Array A string array of IDs identifying the targets used in the merge. The IDs used in this parameter come from the column 'prospect_lists_prospects.id'. campaign_id String The campaign ID used for the mail merge. Result Name Type Description null void No return value. Change Log Version Change v2 Return type was changed from error_value to void. Example PHP $set_campaign_merge_parameters = array( //Session id "session" => $session_id, //A string array of IDs identifying the targets used in the merge. //The IDs used in this parameter come from the column 'prospect_lists_prospects.id'. "targets" => array( '403787cc-ab19-bec8-3ef4-50bd4896c9b3', 'c5341c8d-4b0a-2b56-7108-50bd48b91213' ), //The campaign ID used for the mail merge. "campaign_id" => '781d4471-fb48-8dd2-ae62-50bd475950b2' ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_campaign_merge/index.html
8158334d247d-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. oauth_access Overview Retrieves the OAuth access token. Available APIs REST Definition oauth_access() Parameters Name Type Description session String Session ID returned by a previous login call. Result Name Type Description result Array The call result. result.id String The OAuth access token. Change Log Version Change v4 Added oauth_access method. Examples PHP $oauth_access_parameters = array( //Session id 'session' => $session_id, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/oauth_access/index.html
5ce778aba4cd-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. snip_update_contacts Overview Retrieves new contact emails since a timestamp for the current user. Available APIs REST Definition snip_update_contacts(session, report_id) Parameters Name Type Description session String Session ID returned by a previous login call. report_id String The ID of the report record to generate the PDF for. Result Name Type Description result Array The call result. result.results Boolean The new emails. result.count Integer The count of results. result.message String The return message. Change Log Version Change v4 Added snip_update_contacts method. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/snip_update_contacts/index.html
ed63c92bf06f-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. snip_import_emails Overview Used to imports an email record from the SNIP archiving service. Available APIs REST Definition snip_import_emails(session, email) Parameters Name Type Description session String Session ID returned by a previous login call. email Array The contents of the email being imported. email.message Array Contains the email attributes. email.message.message_id String The ID of the email message. email.message.subject String Email subject. email.message.attachments Array The list of attachments to be imported email.message.from_name String From sender name. email.message.description String Plain text content body. email.message.description_html String HTML email content body. email.message.to_addrs String Email addresses the email was sent to. email.message.cc_addrs String Email addresses the email was CCed to. email.message.bcc_addrs String Email addresses the email was BCCed to. email.message.date_sent String Date the email was sent. Result Name Type Description result Array The call result. result.results Boolean The success of the import. result.count Integer The count of records imported. result.message String The return message. Change Log Version Change v4 Added snip_import_emails method. Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/snip_import_emails/index.html
42f404235a77-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_entries_count Overview Retrieves a list of beans based on query specifications. Available APIs SOAP REST Definition get_entries_count(session, module_name, query, deleted) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. query String The SQL WHERE clause without the word "where". deleted Integer If deleted records should be included in the results. Result Name Type Description result get_entries_count_result | Array The call result. result.result_count Integer The count of total records. Change Log Version Change Examples PHP $get_entries_count_parameters = array( //Session id 'session' => $session_id, //The name of the module from which to retrieve records 'module_name' => 'Accounts', //The SQL WHERE clause without the word "where". 'query' => " accounts.name like '%example text%' ", //If deleted records should be included in results. 'deleted' => false ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entries_count/index.html
31f3628676c6-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_last_viewed Overview Retrieves a list of recently viewed records by module for the current user. Available APIs SOAP REST Definition get_last_viewed(session, module_names) Parameters Name Type Description session String Session ID returned by a previous login call. module_names module_names | Array The list of modules to retrieve last viewed records for. Result Name Type Description result last_viewed_list | Array The call result. Contains a list of reciently viewed records. result[].id Integer The result ID. result[].item_id String The reciently viewed record ID. result[].item_summary String The name of the reciently viewed record. result[].module_name String The name of the module. result[].monitor_id String The monitor ID from the tracker table. result[].date_modified String The date the record was viewed. Change Log Version Change Examples PHP $get_last_viewed_parameters = array( //Session id "session" => $session_id, //The name of the modules to retrieve last viewed for 'module_names' => array( 'Contacts', 'Accounts' ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_last_viewed/index.html
3c9657735cb3-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_note_attachment Overview Retrieves an attachment associated with a specific note record. Available APIs SOAP REST Definition get_note_attachment(session, id) Parameters Name Type Description session String Session ID returned by a previous login call. id String The ID of the note record to associate the attachment to. Result Name Type Description result new_return_note_attachment | Array The call result. result.note_attachment Array The details of the file attachment. result.note_attachment.id String The ID of the note record / attachment. result.note_attachment.filename String The filename of the attachment. result.note_attachment.file String The binary contents of the file. result.note_attachment.related_module_id String The related parent ID. result.note_attachment.related_module_name String The related parent module. Change Log Version Change v2 Return type was changed from return_note_attachment to new_return_note_attachment. Examples PHP $get_note_attachment_parameters = array( //Session id "session" => $session_id, //The ID of the note containing the attachment. 'id' => "9057784d-de17-4f28-c5f9-50bd0f260a43", ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_note_attachment/index.html
6161fd76f9fd-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_quotes_pdf Overview Generates a quote PDF for a specific quote. Available APIs REST Definition get_quotes_pdf(session, quote_id, pdf_format) Parameters Name Type Description session String Session ID returned by a previous login call. quote_id String The ID of the quote record to generate the PDF for. pdf_format String The pdf type requested. 'Standard' is an example. Result Name Type Description result Array The call result. result.file_contents String The binary contents of the PDF file. Change Log Version Change v3_1 Added get_quotes_pdf method. Examples PHP $get_quotes_pdf_parameters = array( //Session id 'session' => $session_id, //The quote to generate the pdf for 'quote_id' => '490cc844-f83a-9b74-9888-50aa575b517c', //The pdf type 'pdf_format' => 'Standard', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_quotes_pdf/index.html
018d1800cd5d-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_language_definition Overview Retrieves the language label strings for the specified modules. Available APIs REST Definition get_available_modules(session, modules, md5) Parameters Name Type Description session String Session ID returned by a previous login call. modules Array The list of modules to retrieve language definitions for. md5 Boolean Setting this to true will return an MD5 hash of the modules labels strings instead of the label strings themselves. Result Name Type Description result Array The call result. Contains a list of modules. result[] Array or String The list of language definitions or MD5 hashes. This is dependent on the 'md5' parameter. Change Log Version Change v3_1 Added get_language_definition method. Examples PHP $get_language_definition_parameters = array( //Session id 'session' => $session_id, //The list of modules 'modules' => array( 'Accounts' ), //Whether to return the results as an MD5 hash 'md5' => false, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_language_definition/index.html
2e7e0c118e09-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_entry Overview Retrieves a single bean based on record ID. Available APIs SOAP REST Definition get_entry(session, module_name, id, select_fields, link_name_to_fields_array, track_view) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. id String The ID of the record to retrieve. select_fields select_fields | Array The list of fields to be returned in the results. Specifying an empty array will return all fields. link_name_to_fields_array link_names_to_fields_array | Array A list of link names and the fields to be returned for each link. track_view Boolean Flag the record as a recently viewed item. Result Name Type Description result get_entry_result_version2 | Array The call result. result.entry_list Array The record's name-value pair for the simple datatypes excluding the link field data. If you do not have access to the object, entry_list[].name_value_list will notify you. result.relationship_list Array The records link field data. Change Log Version Change v3_1 Added track_view parameter. v2 Added link_name_to_fields_array parameter. v2 Return type was changed from get_entry_result to get_entry_result_version2. Examples PHP $get_entry_parameters = array( //session id 'session' => $session_id, //The name of the module from which to retrieve records 'module_name' => "Contacts",
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entry/index.html
2e7e0c118e09-1
'module_name' => "Contacts", //The ID of the record to retrieve. 'id' => "18df70e4-1422-8bff-6f5f-50aa571fe4e5", //The list of fields to be returned in the results 'select_fields' => array( 'id', 'first_name', 'last_name', ), //A list of link names and the fields to be returned for each link name 'link_name_to_fields_array' => array( array( 'name' => 'email_addresses', 'value' => array( 'email_address', 'opt_out', 'primary_address' ), ), ), //Flag the record as a recently viewed item 'track_view' => true, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entry/index.html
a9fcd7ec2738-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_document_revision Overview Retrieves a specific document revision. Available APIs SOAP REST Definition get_document_revision(session, i) Parameters Name Type Description session String Session ID returned by a previous login call. i String The ID of the document revision. Result Name Type Description result new_return_document_revision| Array The call result. result.document_revision Array The details of the document revision. result.document_revision.id String The document ID. result.document_revision.document_name String The document name. result.document_revision.revision String The document revision number result.document_revision.filename String The filename of the file. result.document_revision.file String The binary contents of the file. Change Log Version Change v2 Return type was changed from return_document_revision to new_return_document_revision. Examples PHP $get_document_revision_parameters = array( //Session id "session" => $session_id, //The attachment details "i" => '723b7dcb-27b3-e53d-b348-50bd283f8e48', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_document_revision/index.html
be6ed1322c87-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. job_queue_next Overview Retrieves the next job from the job queue and marks it as 'In Progress'. Available APIs REST Definition job_queue_next(session, clientid) Parameters Name Type Description session String Session ID returned by a previous login call. clientid String The client id calling the application. This parameter is of your choosing for the calling application. Result Name Type Description result Array The call result. result.results String The next job ID. Change Log Version Change v4 Added job_queue_next method. Examples PHP $job_queue_next_parameters = array( //Session id 'session' => $session_id, //The ID of the calling application. 'clientid' => 'MyAppID', ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/job_queue_next/index.html
b8f8c368f1ad-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_entries Overview Retrieves a list of beans based on specified record IDs. Available APIs SOAP REST Definition get_entries(session, module_name, ids, select_fields, link_name_to_fields_array, track_view) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. ids String The list of record IDs to retrieve. select_fields select_fields | Array The list of fields to be returned in the results. Specifying an empty array will return all fields. link_name_to_fields_array link_names_to_fields_array | Array A list of link names and the fields to be returned for each link. track_view Boolean Flag the record as a recently viewed item. Result Name Type Description result get_entry_result_version2 | Array The call result. result.entry_list Array The record's name-value pair for the simple datatypes excluding the link field data. If you do not have access to the object, entry_list[].name_value_list will notify you. result.relationship_list Array The records link field data. Change Log Version Change v3_1 Added track_view parameter. v2 Added link_name_to_fields_array parameter. v2 Return type was changed from get_entry_result to get_entry_result_version2. Examples PHP $get_entries_parameters = array( //session id 'session' => $session_id, //The name of the module from which to retrieve records 'module_name' => 'Accounts',
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entries/index.html
b8f8c368f1ad-1
'module_name' => 'Accounts', //An array of record IDs 'ids' => array( '14b0c0ca-3ea2-0ee8-f3be-50aa57c11ee7', ), //The list of fields to be returned in the results 'select_fields' => array( 'name', 'billing_address_state', 'billing_address_country' ), //A list of link names and the fields to be returned for each link name 'link_name_to_fields_array' => array( array( 'name' => 'email_addresses', 'value' => array( 'email_address', 'opt_out', 'primary_address' ), ), ), //Flag the record as a recently viewed item 'track_view' => true, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_entries/index.html
c09ee9f02e3b-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_note_attachment Overview Creates an attachment and associated it to a specific note record. Available APIs SOAP REST Definition set_note_attachment(session, note) Parameters Name Type Description session String Session ID returned by a previous login call. note new_note_attachment | Array The file attachment details note.id String The ID of the note record to associate the attachment to. note.filename String The file name of the file attachment. note.file String The binary contents of the file. Result Name Type Description result new_set_entry_result | Array The call result. result.id String The ID of the note record / attachment Change Log Version Change v2 Return type was changed from set_entry_result to new_set_entry_result. v2 Parameter note type change from note_attachment to new_note_attachment. Examples PHP $file_contents = file_get_contents("/path/to/example_file.php"); $set_note_attachment_parameters = array( //Session id "session" => $session_id, //The attachment details "note" => array( //The ID of the note containing the attachment. 'id' => $note_id, //The file name of the attachment. 'filename' => 'example_file.php', //The binary contents of the file. 'file' => base64_encode($file_contents), ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_note_attachment/index.html
3090a5b950e0-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. set_entry Overview Creates or updates a specific record. Available APIs SOAP REST Definition set_entry(session, module_name, name_value_list) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. name_value_list name_value_list | Array The name/value list of the record attributes. Result Name Type Description result new_set_entry_result | Array The call result. result.id String The ID of the record that was created/updated. Change Log Version Change v2 Return type was changed from set_entry_result to new_set_entry_result. Considerations To update an existing record, you will need to specify 'id' in the name_value_list parameter. To create a new record with a specific ID, you will need to set 'new_with_id' in the name_value_list parameter. Examples PHP $set_entry_parameters = array( //session id "session" => $session_id, //The name of the module from which to retrieve records. "module_name" => "Accounts", //Record attributes "name_value_list" => array( //to update a record /* array( "name" => "id", "value" => "da0b107d-cfbc-cb08-4f90-50b7b9cb9ad7" ), */ //to create a new record with a specific ID /* array(
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_entry/index.html
3090a5b950e0-1
//to create a new record with a specific ID /* array( "name" => "new_with_id", "value" => true ), */ array( "name" => "name", "value" => "Example Account" ), ), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/set_entry/index.html
758d006b1395-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_modified_relationships Overview Retrieves a list of modified relationships between a specific date range. Helps facilitate sync operations for users. Available APIs SOAP REST Definition get_modified_relationships(session, module_name, related_module, from_date, to_date, offset, max_results, deleted, module_user_id, select_fields, relationship_name, deletion_date) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The module key to retrieve relationships against. related_module String The related module key to retrieve records off of. This parameter should always be 'Users'. from_date String Start date in YYYY-MM-DD HH:MM:SS format for the date range. to_date String End date in YYYY-MM-DD HH:MM:SS format for the date range. offset Integer The offset to begin returning records from. max_results Integer The max_results to return. deleted Integer Whether or not to include deleted records. Set to 1 to find deleted records. module_user_id String *This parameter is no longer used and is only present for backward compatibility purposes. select_fields select_fields List of fields to select and return as name/value pairs. relationship_name String The name of the relationship name to search on. deletion_date String Date value in YYYY-MM-DD HH:MM:SS format for filtering on deleted records whose date_modified falls within range. Result Name Type Description result modified_relationship_result | Array The call result. result.result_count Integer The result count. result.next_offset Integer The next offset to retrieve from. result.entry_list Array List of found records. result.error
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_modified_relationships/index.html
758d006b1395-1
result.entry_list Array List of found records. result.error Array Error Message. result.error.number Integer The error number. result.error.name String The name of the error. result.error.description String The description of the error. Change Log Version Change v4_1 Added get_modified_relationships method. Considerations The module_name parameter should always be 'Users'. Examples PHP $get_modified_relationships_parameters = array( //Session id 'session' => $session_id, //The module key to retrieve relationships against. //This parameter should always be 'Users'. 'module_name' => 'Users', //The related module key to retrieve records off of. 'related_module' => 'Meetings', //Start date in YYYY-MM-DD HH:MM:SS format for the date range. 'from_date' => '2000-01-01 01:01:01', //End date in YYYY-MM-DD HH:MM:SS format for the date range 'to_date' => '2013-01-01 01:01:01', //The offset to begin returning records from. 'offset' => 0, //The max_results to return. 'max_results' => 5, //Whether or not to include deleted records. Set to 1 to find deleted records. 'deleted' => 0, //This parameter is not used. 'module_user_id' => '', //List of fields to select and return as name/value pairs. 'select_fields' => array(), //The name of the relationship name to search on. 'relationhip_name' => 'meetings_users',
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_modified_relationships/index.html
758d006b1395-2
'relationhip_name' => 'meetings_users', //Date value in YYYY-MM-DD HH:MM:SS format for filtering on deleted records. 'deletion_date' => '2012-01-01 01:01:01' ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_modified_relationships/index.html
ddd3342a2bee-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_module_layout Overview Retrieves the layout metadata for a given module given a specific type and view. Available APIs REST Definition get_module_layout(session, modules, types, views, acl_check, md5) Parameters Name Type Description session String Session ID returned by a previous login call. modules Array The list of modules to retrieve layouts for. types Array The types of views requested. Current supported types are 'default' (for application) and 'wireless'. views Array The views requested. Current supported types are 'edit', 'detail', 'list', and 'subpanel'. acl_check Boolean Whether or not to check for ACL access. md5 Boolean Setting this to true will return an MD5 hash of the modules layouts instead of the layouts themselves. Result Name Type Description result Array The call result. Contains a list of modules. result[][$type] Array The list of types requested. result[][$view] Array or String The list of layout views requested or MD5 hashes. This is dependent on the 'md5' parameter. Change Log Version Change v3_1 Added acl_check parameter. v3 Added get_module_layout method. Examples PHP $get_module_layout_parameters = array( //Session id 'session' => $session_id, //The list of modules 'modules' => array( 'Accounts' ), //The types of views requested 'types' => array( 'default', ), //The views requested 'views' => array( 'edit' ),
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_layout/index.html
ddd3342a2bee-1
'views' => array( 'edit' ), //Whether or not to check for ACL access 'acl_check' => false, //Whether to return the results as an MD5 hash 'md5' => true, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_layout/index.html
0a616c2d703d-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_relationships Overview Retrieves a specific relationship link for a specified record. Available APIs SOAP REST Definition get_relationships(session, module_name, module_id, link_field_name, related_module_query, related_fields, related_module_link_name_to_fields_array, deleted, order_by, offset, limit) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. module_id String The ID of the specified module record. link_field_name String The name of the link field for the related module. related_module_query String The list of related record IDs you are relating related_fields select_fields | Array An array specifying relationship fields to populate. An example of this is contact_role between Opportunities and Contacts. related_module_link_name_to_fields_array link_names_to_fields_array | Array For every related record returned, specify link field names to field information. deleted Integer order_by String The SQL ORDER BY clause without the phrase "order by". offset Integer The record offset from which to start. limit Integer The maximum number of results to return. Result Name Type Description result get_entry_result_version2 | Array The call result. result.entry_list Array The record's name-value pair for the simple datatypes excluding the link field data. If you do not have access to the object, entry_list[].name_value_list will notify you. result.relationship_list Array The records link field data. Change Log Version Change v3 Added order_by parameter.
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_relationships/index.html
0a616c2d703d-1
Change Log Version Change v3 Added order_by parameter. v2 Removed related_module parameter. v2 Added link_field_name parameter. v2 Added related_fields parameter. v2 Added related_module_link_name_to_fields_array parameter. v2 Return type was changed from get_relationships_result to get_entry_result_version2. Examples PHP $get_relationships_parameters = array( //session id 'session' => $session_id, //The name of the module from which to retrieve records. 'module_name' => 'Accounts', //The ID of the specified module bean. 'module_id' => '9f0c0ceb-c512-7103-9456-50aa5787c3f6', //The relationship name of the linked field from which to return records. 'link_field_name' => 'opportunities', //The portion of the WHERE clause from the SQL statement used to find the related items. 'related_module_query' => " opportunities.name IS NOT NULL ", //The related fields to be returned. 'related_fields' => array( 'id', 'name' ), //For every related bean returned, //specify link field names to field information. 'related_module_link_name_to_fields_array' => array( array( 'name' => 'contacts', 'value' => array( 'id', 'first_name', 'last_name', ), ), ), //To exclude deleted records 'deleted'=> 0, //order by 'order_by' => ' opportunities.name ', //offset 'offset' => 0, //limit
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_relationships/index.html
0a616c2d703d-2
//offset 'offset' => 0, //limit 'limit' => 200, ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_relationships/index.html
06af186bca60-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_report_entries Overview Retrieves a list of report entries based on specified record IDs. Available APIs SOAP REST Definition get_report_entries(session, ids, select_fields) Parameters Name Type Description session String Session ID returned by a previous login call. ids select_fields | Array An array of record IDs to retrieve. select_fields select_fields | Array The list of fields to be included in the results. Result Name Type Description result get_entry_result_for_reports | Array The call result. result.field_list Array The list of selected fields. result.field_list[].name String The name of the report. result.field_list[].type String The type of the report. result.field_list[].label String The label of the report. result.field_list[].required Boolean result.field_list[].options Array result.entry_list Array The list of report results result.entry_list[].id String The result ID. This is not the record ID. result.entry_list[].module_name String The name of the module. Normally contains the value 'Reports'. result.entry_list[].name_value_list Array The name value list of the report results. Change Log Version Change v2 Method get_report_entries was added. Considerations This method is not available in CE. Examples PHP $get_report_entries_parameters = array( //Session id 'session' => $session_id, //An array of record IDs to retrieve. 'ids' => array( '63f1b905-d206-14cb-cb95-50aa5734815f' ),
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_report_entries/index.html
06af186bca60-1
), //The list of fields to be included in the results. 'select_fields' => array() ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_report_entries/index.html
3279c62f324a-0
This API has been succeeded by a new version. It is recommended to upgrade to the latest API. get_module_fields Overview Retrieves the list of field vardefs for a specific module. Available APIs SOAP REST Definition get_module_fields(session, module_name, fields) Parameters Name Type Description session String Session ID returned by a previous login call. module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name. fields select_fields | Array The list of fields to retrieve. An empty parameter will return all. Result Name Type Description result new_module_fields | Array The call result. result.module_name String The name of the module. result.table_name String The name of the modules primary table. result.module_fields Array The vardefs for each individual field. Change Log Version Change v2 Added fields parameter. v2 Return type was changed from module_fields to new_module_fields. Examples PHP $get_module_fields_parameters = array( //Session id "session" => $session_id, //The name of the module from which to retrieve fields 'module_name' => "Contacts", //List of specific fields 'fields' => array(), ); Last modified: 2023-02-03 21:04:03
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/Legacy_API/Methods/get_module_fields/index.html
3fd6acf5f208-0
REST API Overview v10 - v11.20 API documentation. What Is REST? REST stands for 'Representational State Transfer'. As of 7.x, REST is a core component of Sugar that defines how all information is exchanged within the application. The v10+ API is separate from the v1 - v4_1 REST APIs in that it has been rebuilt with the latest REST standards. Most functionality in the system, whether fetching or posting data, is interacting with the API in some way. Getting Started How to Access the REST Service The base endpoint for the REST service can be found at https://<site_url>/rest/v{version}/. Note: version refers to the version of the API you are accessing. For your reference, the help documentation for all versioned endpoints can be found by navigating to https://<site_url>/rest/v{version}/help. Once you have identified your instance's base endpoint, we can begin by authenticating. Authentication Sugar uses two-legged OAuth2 for authentication. You simply need to do a POST to /rest/<version>/oauth2/token with the following parameters: grant_type String Type of request. Available grant types are "password" and "refresh_token". client_id String The client_id of "sugar" will automatically create an OAuth Key in the system and can be used for "password" authentication. The client_id of "support_portal" will create an OAuth Key if the portal system is enabled and will allow for portal authentication. Other client_id's can be created by the administrator in the OAuthKeys section in the Administration section and can be used in the future for additional grant types, if the client secret is filled in, it will be checked to validate the use of the client id. client_secret String The client's secret key. username String
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/index.html
3fd6acf5f208-1
client_secret String The client's secret key. username String The username of the user authenticating to the system. password String The plaintext password the user authenticating to the system. platform String Defaults to "base" allows you to have custom meta-data per platform. If using a value other than "base", you should make sure it is registered using the Platform extension or configure an API platform in Administration panel. First, we are going to log in using a grant_type of "password" and a platform of "custom". Normally, when logging into Sugar, users log in with a platform type of "base". We are using "custom" to avoid any potential login conflicts. curl -X POST -H Cache-Control:no-cache -H "Content-Type: application/json" -d '{ "grant_type":"password", "client_id":"sugar", "client_secret":"", "username":"<username>", "password":"<password>", "platform":"custom" }' https:/<site_url>/rest/<version>/oauth2/token Once you get the response you will need to hold onto the access_token and the refresh_token. Anytime the access_token is invalidated, you will want to make another request to the token endpoint with a grant_type of "refresh_token". Store just the refresh_token in long-term storage – not the username and password. The response from the server will be as follows: { "access_token": "5ee48ec7-023e-ecff-5184-530bd0358868", "expires_in": 3600,
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/index.html
3fd6acf5f208-2
"expires_in": 3600, "token_type": "bearer", "scope": null, "refresh_token": "5f197357-0167-f7a6-7912-530bd03275b6", "refresh_expires_in": 1209600, "download_token": "5f531625-e301-e3ea-1b11-530bd098be41" } Avoiding Login Conflicts Login conflicts often occur when building integrations or running data migrations with the platform of "base" or any other client type that is in use. This is due to the fact that Sugar uses the same REST API to power all the various clients such as Sugar, Portal, Mobile, and even the Outlook Plugin. Due to this, you need to let the API know you aren't conflicting with another client that may be in use. The way to accomplish this is the /rest/<version>/oauth2/token call by changing the platform parameter to something other than "base", "mobile", or "portal". It is best to name it something that describes and identifies your current integration. Input / Output Data Types The default input / output datatype for REST is JSON. Date Handling Date and date time inputs should be formatted following the ISO 8601 format. If the time zone is not included in a request, Sugar will assume the time zone of the user making the request. Filter on a specific date: { "date_start": "2015-08-12" } Filter on a date keyword using $dateRange: { "date_start": { "$dateRange": "today" } } Filter on date range using manual time zones: { "date_start": { "$dateBetween": [
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/index.html
3fd6acf5f208-3
{ "date_start": { "$dateBetween": [ "2015-09-10T00:00:00+10:00", "2015-09-10T23:59:59+10:00" ] } } TopicsEndpointsThe following sections contain the in-app help documentation for the REST endpoints.Extending EndpointsHow to add your own custom endpoints to the REST API.API ExceptionsSugar comes with some predefined API Exceptions, located in ./include/api/, that can be called from API endpoints. These exceptions return a specific HTTP code and a message. Last modified: 2023-04-05 00:08:11
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/index.html
26cf9eac6623-0
API Exceptions Overview Sugar comes with some predefined API Exceptions, located in ./include/api/, that can be called from API endpoints. These exceptions return a specific HTTP code and a message. Stock Exceptions Exception Class HTTP Code Error Label Language Label Key Language Label Value SugarApiExceptionError 500  fatal_error  EXCEPTION_FATAL_ERROR  Your request failed to complete. A fatal error occurred. Check logs for more details. SugarApiExceptionIncorrectVersion 301 incorrect_version EXCEPTION_INCORRECT_VERSION  The version of the API you are using is not correct for the current request. SugarApiExceptionNeedLogin 401 need_login EXCEPTION_NEED_LOGIN  You need to be logged in to perform this action. SugarApiExceptionInvalidGrant 401 invalid_grant EXCEPTION_INVALID_TOKEN  Your authentication token is invalid. SugarApiExceptionNotAuthorized 403 not_authorized EXCEPTION_NOT_AUTHORIZED You are not authorized to perform this action. Contact your administrator if you need access. SugarApiExceptionPortalUserInactive 403 inactive_portal_user EXCEPTION_INACTIVE_PORTAL_USER  You cannot access Portal because your portal account is inactive. Please contact customer support if you need access. SugarApiExceptionPortalNotConfigured 403 portal_not_configured EXCEPTION_PORTAL_NOT_CONFIGURED  Portal is not configured properly. Contact your Portal Administrator for assistance. SugarApiExceptionNoMethod 404 no_method EXCEPTION_NO_METHOD  Your request was not supported. Could not find the HTTP method of your request for this path. SugarApiExceptionNotFound 404 not_found EXCEPTION_NOT_FOUND  Your requested resource was not found. Could not find a handler for the path specified in the request. SugarApiExceptionEditConflict 409 edit_conflict
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/API_Exceptions/index.html
26cf9eac6623-1
SugarApiExceptionEditConflict 409 edit_conflict EXCEPTION_EDIT_CONFLICT  Edit conflict, please reload the record data. SugarApiExceptionInvalidHash 412 metadata_out_of_date EXCEPTION_METADATA_OUT_OF_DATE Your metadata or user hash did not match the server. Please resync your metadata. SugarApiExceptionRequestTooLarge 413 request_too_large EXCEPTION_REQUEST_TOO_LARGE Your request is too large to process. SugarApiExceptionMissingParameter 422 missing_parameter EXCEPTION_MISSING_PARAMTER A required parameter in your request was missing. SugarApiExceptionInvalidParameter 422 invalid_parameter EXCEPTION_INVALID_PARAMETER A parameter in your request was invalid. SugarApiExceptionRequestMethodFailure 424 request_failure EXCEPTION_REQUEST_FAILURE Your request failed to complete. SugarApiExceptionClientOutdated 433 client_outdated EXCEPTION_CLIENT_OUTDATED Your software is out of date, please update your client before attempting to connect again. SugarApiExceptionConnectorResponse 502 bad_gateway EXCEPTION_CONNECTOR_RESPONSE A connector or an integration request resulted in a failed response. SugarApiExceptionMaintenance 503 maintenance EXCEPTION_MAINTENANCE SugarCRM is in maintenance mode. Only admins can login. Please contact your administrator for details. SugarApiExceptionServiceUnavailable 503 service_unavailable EXCEPTION_SERVICE_UNAVAILABLE The server cannot process your request because it is busy or unavailable at this time. SugarApiExceptionSearchUnavailable 400 search_unavailable EXCEPTION_SEARCH_UNAVAILABLE Search engine is temporarily unavailable. SugarApiExceptionSearchRuntime 400 search_runtime EXCEPTION_SEARCH_RUNTIME  A search engine runtime error occurred. Please contact your System Administrator. Using Exceptions
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/API_Exceptions/index.html
26cf9eac6623-2
A search engine runtime error occurred. Please contact your System Administrator. Using Exceptions When extending endpoints in Sugar, the stock API exceptions can be used to return errors and messages. The exception classes accept a single parameter on creation for the message value to return. This parameter can accept language label keys or plain text. If no parameter is passed exception, the error will default to the exception's default language label key. To call a stock API exception from custom code add the following snippet : //throwing an api exception using the stock message throw new SugarApiExceptionError(); //throwing an api exception using a custom language label key throw new SugarApiExceptionError('EXCEPTION_CSTM_LABEL_KEY'); //throwing an api exception with text throw new SugarApiExceptionError('There has been an error.'); This will return an http response code of 500 with the following response data: { "error": "fatal_error", "error_message": "There has been an error." } Custom Exceptions Sugar gives you the ability to create custom API exceptions by creating a new class in ./custom/include/api/ that extends the stock SugarApiException class. When extending the class you can provide the following properties in your custom code: $httpCode The http response code to send back in the header. Defaults to 400 if not specified. $errorLabel The string value returned in the 'error' key response. $messageLabel The label to return as a default response if a message is not provided. Example The following example will demonstrate how to create a custom exception. ./custom/include/api/<name>.php <?php require_once 'include/api/SugarApiException.php'; /** * Custom error. */ class cstmSugarApiExceptionError extends SugarApiException {
https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Integration/Web_Services/REST_API/API_Exceptions/index.html