Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
Mike Russell edited this page Aug 10, 2016 · 10 revisions

#Namespace SugarAPI\SDK\Client\

#Interface SugarAPI\SDK\Client\Interfaces\ClientInterface

##Methods ###setServer($server) Set the server property on the Client object. Server property is used to define the API Url Property. ####Arguments

Name Type Description
$server string The server URL where the API resides
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###setCredentials(array $credentials) Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###login() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###logout() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###refreshToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

####registerEndpoint($function,$Endpoint) Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###getServer() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###getAPIUrl() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###getCredentials() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###setToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###getToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###authenticated() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###storeToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###getStoredToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

###removeStoredToken() Set the Authentication Credentials being used by the Client Object to authenticate to the API ####Arguments

Name Type Description
$credentials array Array of credentials required for the API
####Returns
Type Description
---- -----------
self The current Client Object for method chaining

#Abstracts There are two Abstract Clients included in the Rest PHP Client Framework. Both abstracts implemtnations of a Rest Client are in the following Namespace \SugarAPI\SDK\Client\Abstracts.

| Name | Description | | AbstractClient | A generic client implementation, that can be extended and altered for use with any Rest API | | AbstractSugarClient | Extends the AbstractClient and implements all required logic to work strictly with the Sugar 7 REST Api |

#Implementations

#Usage

Clone this wiki locally