soap/SoapSugarUsers.php
Functions
get_available_modules(
String $session
)
:
Array
Retrieve the list of available modules on the system available to the currently logged in user.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
Array | 'modules' -- An array of module names 'error' -- The SOAP error, if any |
get_document_revision(
String $session, String $id
)
:
\return_document_revision
This method is used as a result of the .htaccess lock down on the cache directory. It will allow a properly authenticated user to download a document that they have proper rights to download.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$id | String | -- ID of the document revision to obtain |
Type | Description |
---|---|
\return_document_revision | - this is a complex type as defined in SoapTypes.php |
get_entries(
String $session, String $module_name, Array $ids, Array $select_fields
)
:
Array
Retrieve a list of SugarBean's based on provided IDs.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$ids | Array | -- An array of SugarBean IDs. |
$select_fields | Array | -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
Type | Description |
---|---|
Array | 'field_list' -- Var def information about the returned fields 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_entries_count(
\session $session, \module_name $module_name, \query $query, \deleted $deleted
)
:
\get_entries_count_result
Retrieve number of records in a given module
Name | Type | Description |
---|---|---|
$session | \session | the session id of the authenticated user |
$module_name | \module_name | module to retrieve number of records from |
$query | \query | allows webservice user to provide a WHERE clause |
$deleted | \deleted | specify whether or not to include deleted records |
Type | Description |
---|---|
\get_entries_count_result | - this is a complex type as defined in SoapTypes.php |
get_entry(
String $session, String $module_name, String $id, Array $select_fields
)
:
\unknown
Retrieve a single SugarBean based on ID.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$id | String | -- The SugarBean's ID value. |
$select_fields | Array | -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
Type | Description |
---|---|
\unknown |
get_entry_list(
String $session, String $module_name, String $query, String $order_by, String $offset, Array $select_fields, String $max_results, \Number $deleted
)
:
Array
Retrieve a list of beans. This is the primary method for getting list of SugarBeans from Sugar using the SOAP API.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$query | String | -- SQL where clause without the word 'where' |
$order_by | String | -- SQL order by clause without the phrase 'order by' |
$offset | String | -- The record offset to start from. |
$select_fields | Array | -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
$max_results | String | -- The maximum number of records to return. The default is the sugar configuration value for 'list_max_entries_per_page' |
$deleted | \Number | -- false if deleted records should not be include, true if deleted records should be included. |
Type | Description |
---|---|
Array | 'result_count' -- The number of records returned 'next_offset' -- The start of the next page (This will always be the previous offset plus the number of rows returned. It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be. 'field_list' -- The vardef information on the selected fields. Array -- 'field'=> 'name' -- the name of the field 'type' -- the data type of the field 'label' -- the translation key for the label of the field 'required' -- Is the field required? 'options' -- Possible values for a drop down field 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_gmt_time(
)
:
String
Return the current time on the server in the format 'Y-m-d H:i:s'. This time is in GMT.
Type | Description |
---|---|
String | -- The current date/time 'Y-m-d H:i:s' |
get_mailmerge_document(
String $session, \unknown_type $file_name, \unknown_type $fields
)
:
\unknown
Get MailMerge document
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$file_name | \unknown_type | |
$fields | \unknown_type |
Type | Description |
---|---|
\unknown |
get_mailmerge_document2(
String $session, \unknown_type $file_name, \unknown_type $fields
)
:
\unknown
Enter description here...
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$file_name | \unknown_type | |
$fields | \unknown_type |
Type | Description |
---|---|
\unknown |
get_module_fields(
String $session, String $module_name
)
:
Array
Retrieve vardef information on the fields of the specified bean.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
Type | Description |
---|---|
Array | 'module_fields' -- The vardef information on the selected fields. 'error' -- The SOAP error, if any |
get_note_attachment(
String | String $session, String $id
)
:
ArrayArray
Retrieve an attachment from a note
Name | Type | Description |
---|---|---|
$session | String | String | -- Session ID returned by a previous call to login. |
$id | String | -- The ID of the appropriate Note. |
Type | Description |
---|---|
ArrayArray | 'id' -- The ID of the new note or -1 on error 'error' -- The SOAP error if any.'note_attachment' -- Array String 'id' -- The ID of the Note containing the attachment String 'filename' -- The file name of the attachment Binary 'file' -- The binary contents of the file. 'error' -- The SOAP error if any. |
get_related_notes(
String $session, String $module_name, String $module_id, Array $select_fields
)
:
Array
Retrieve the collection of notes that are related to a bean.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$module_id | String | -- The ID of the bean that you want to associate the note with |
$select_fields | Array | -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
Type | Description |
---|---|
Array | 'result_count' -- The number of records returned (-1 on error) 'next_offset' -- The start of the next page (This will always be the previous offset plus the number of rows returned. It does not indicate if there is additional data unless you calculate that the next_offset happens to be closer than it should be. 'field_list' -- The vardef information on the selected fields. 'entry_list' -- The records that were retrieved 'error' -- The SOAP error, if any |
get_relationships(
String $session, String $module_name, String $module_id, String $related_module, String $related_module_query, \Number $deleted
)
:
\unknown
Retrieve a collection of beans tha are related to the specified bean.
As of 4.5.1c, all combinations of related modules are supported
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$module_id | String | -- The ID of the bean in the specified module |
$related_module | String | -- The name of the related module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$related_module_query | String | -- A portion of the where clause of the SQL statement to find the related items. The SQL query will already be filtered to only include the beans that are related to the specified bean. |
$deleted | \Number | -- false if deleted records should not be include, true if deleted records should be included. |
Type | Description |
---|---|
\unknown |
get_server_time(
)
:
String
Return the current time on the server in the format 'Y-m-d H:i:s'. This time is in the server's default timezone.
Type | Description |
---|---|
String | -- The current date/time 'Y-m-d H:i:s' |
get_server_version(
)
:
String
Retrieve the version number of Sugar that the server is running.
Type | Description |
---|---|
String | -- The current sugar version number. '1.0' on error. |
get_sugar_flavor(
)
:
String
Retrieve the specific flavor of sugar.
Type | Description |
---|---|
String | 'CE' -- For Community Edition 'PRO' -- For Professional 'ENT' -- For Enterprise |
get_user_id(
String $session
)
:
String
Return the user_id of the user that is logged into the current session.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
String | -- the User ID of the current session -1 on error. |
get_user_team_id(
String $session
)
:
String
Return the ID of the default team for the user that is logged into the current session.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
String | -- the Team ID of the current user's default team 1 for Community Edition -1 on error. |
handle_set_entries(
$module_name, $name_value_lists, $select_fields
=
FALSE
)
:
void
Name | Type | Description |
---|---|---|
$module_name | ||
$name_value_lists | ||
$select_fields |
handle_set_relationship(
Array $set_relationship_value, $session
=
''
)
:
\Empty
(Internal) Create a relationship between two beans.
Name | Type | Description |
---|---|---|
$set_relationship_value | Array | -- 'module1' -- The name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module2_id' -- The ID of the bean in the specified module |
$session |
Type | Description |
---|---|
\Empty | error on success, Error on failure |
is_loopback(
)
:
truefalse
Check to see if the soap server and client are on the same machine.
We don't allow a server to sync to itself.
Type | Description |
---|---|
truefalse | -- if the SOAP server and client are on the same machine-- if the SOAP server and client are not on the same machine. |
is_user_admin(
String $session
)
:
int
Return if the user is an admin or not
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
int | 1 or 0 depending on if the user is an admin |
is_valid_ip_address(
string $session_var
)
:
bool
Use the same logic as in SugarAuthenticate to validate the ip address
Name | Type | Description |
---|---|---|
$session_var | string |
Type | Description |
---|---|
bool | - true if the ip address is valid, false otherwise. |
login(
\UserAuth $user_auth, String $application
)
:
\Array(session_id,
Log the user into the application
Name | Type | Description |
---|---|---|
$user_auth | \UserAuth | array $user_auth -- Set user_name and password (password needs to be in the right encoding for the type of authentication the user is setup for. For Base sugar validation, password is the MD5 sum of the plain text password. |
$application | String | -- The name of the application you are logging in from. (Currently unused). |
Type | Description |
---|---|
\Array(session_id, | error) -- session_id is the id of the session that was created. Error is set if there was any error during creation. |
logout(
String $session
)
:
\Empty
Log out of the session. This will destroy the session and prevent other's from using it.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
\Empty | error on success, Error on failure |
relate_note_to_module(
String $session, String $note_id, String $module_name, String $module_id
)
:
\no
Attach a note to another bean. Once you have created a note to store an attachment, the note needs to be related to the bean.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$note_id | String | -- The ID of the note that you want to associate with a bean |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$module_id | String | -- The ID of the bean that you want to associate the note with |
Type | Description |
---|---|
\no | error for success, error for failure |
seamless_login(
String $session
)
:
truefalse
Perform a seamless login. This is used internally during the sync process.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
Type | Description |
---|---|
truefalse | -- if the session was authenticated-- if the session could not be authenticated |
search_by_module(
string $user_name, string $password, string $search_string, \string[] $modules, int $offset, int $max_results
)
:
\get_entry_list_result
Given a list of modules to search and a search string, return the id, module_name, along with the fields as specified in the $query_array
Name | Type | Description |
---|---|---|
$user_name | string |
|
$password | string |
|
$search_string | string |
|
$modules | \string[] |
|
$offset | int |
|
$max_results | int |
|
Type | Description |
---|---|
\get_entry_list_result | - id, module_name, and list of fields from each record |
set_campaign_merge(
\session $session, \targets $targets, \campaign_id $campaign_id
)
:
\error_value
Once we have successfuly done a mail merge on a campaign, we need to notify Sugar of the targets and the campaign_id for tracking purposes
Name | Type | Description |
---|---|---|
$session | \session | the session id of the authenticated user |
$targets | \targets | a string array of ids identifying the targets used in the merge |
$campaign_id | \campaign_id | the campaign_id used for the merge |
Type | Description |
---|---|
\error_value |
set_document_revision(
String $session, \unknown_type $document_revision
)
:
\unknown
Enter description here...
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$document_revision | \unknown_type |
Type | Description |
---|---|
\unknown |
set_entries(
String $session, String $module_name, Array $name_value_lists
)
:
Array
Update or create a list of SugarBeans
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$name_value_lists | Array | -- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
Type | Description |
---|---|
Array | 'ids' -- Array of the IDs of the beans that was written to (-1 on error) 'error' -- The SOAP error if any. |
set_entries_details(
String $session, String $module_name, Array $name_value_lists, Array $select_fields
)
:
Array
Update or create a list of SugarBeans, returning details about the records created/updated
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$name_value_lists | Array | -- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
$select_fields | Array | -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved. |
Type | Description |
---|---|
Array | 'name_value_lists' -- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. 'error' -- The SOAP error if any. |
set_entry(
String $session, String $module_name, Array $name_value_list
)
:
Array
Update or create a single SugarBean.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$module_name | String | -- The name of the module to return records from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. |
$name_value_list | Array | -- The keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have. |
Type | Description |
---|---|
Array | 'id' -- the ID of the bean that was written to (-1 on error) 'error' -- The SOAP error if any. |
set_note_attachment(
String $session, \Binary $note
)
:
Array
Add or replace the attachment on a Note.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$note | \Binary | -- The flie contents of the attachment. |
Type | Description |
---|---|
Array | 'id' -- The ID of the new note or -1 on error 'error' -- The SOAP error if any. |
set_relationship(
String $session, Array $set_relationship_value
)
:
\Empty
Set a single relationship between two beans. The items are related by module name and id.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$set_relationship_value | Array | -- 'module1' -- The name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module2_id' -- The ID of the bean in the specified module |
Type | Description |
---|---|
\Empty | error on success, Error on failure |
set_relationships(
String $session, Array $set_relationship_list
)
:
\Empty
Setup several relationships between pairs of beans. The items are related by module name and id.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$set_relationship_list | Array | -- One for each relationship to setup. Each entry is itself an array. 'module1' -- The name of the module that the primary record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module1_id' -- The ID of the bean in the specified module 'module2' -- The name of the module that the related record is from. This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method).. 'module2_id' -- The ID of the bean in the specified module |
Type | Description |
---|---|
\Empty | error on success, Error on failure |
update_portal_user(
String $session, String $portal_name, Array $name_value_list
)
:
\Empty
Update the properties of a contact that is portal user. Add the portal user name to the user's properties.
Name | Type | Description |
---|---|---|
$session | String | -- Session ID returned by a previous call to login. |
$portal_name | String | -- The portal user_name of the contact |
$name_value_list | Array | -- collection of 'name'=>'value' pairs for finding the contact |
Type | Description |
---|---|
\Empty | error on success, Error on failure |
validate_authenticated(
String $session_id
)
:
truefalse
Validate the provided session information is correct and current. Load the session.
Name | Type | Description |
---|---|---|
$session_id | String | -- The session ID that was returned by a call to login. |
Type | Description |
---|---|
truefalse | -- If the session is valid and loaded.-- if the session is not valid. |