-
Notifications
You must be signed in to change notification settings - Fork 31
Endpoint
SugarAPI\SDK\Endpoint\
SugarAPI\SDK\Endpoint\Interfaces\EndpointInterface
Set any options on the Endpoint that are needed to manage the url, data, requests, response any logic really
Name | Type | Description |
---|---|---|
$options |
array | An array of options |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Sets the data on the Endpoint Object. This can be either the exact data that will be passed to the Request object, or a shorthand or altered set of data, that is then configured and passed to the Request
Name | Type | Description |
---|---|---|
$data |
array | An array of data which will be parsed and passed to the Request |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Set the full URL that the Endpoint submits data to
Name | Type | Description |
---|---|---|
$url |
string | The full URL the Endpoint submits data to |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Set the Request Object used by the Endpoint
Name | Type | Description |
---|---|---|
$Request |
SugarAPI\SDK\Request\Interfaces\RequestInterface | The Request Object that is to be used by the Endpoint |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Set the Response Object used by the Endpoint
Name | Type | Description |
---|---|---|
$Request |
SugarAPI\SDK\Response\Interfaces\ResponseInterface | The Response Object that is to be used by the Endpoint |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Configure authentication on the Endpoint. In Sugar's REST API, this is used to store just the 'access_token' on the Endpoint, which can then be properly added to the Header of the Request.
Name | Type | Description |
---|---|---|
$token |
mixed | The necessary authentication information that needs to be added to the Request |
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Check if Authentication is required for this API Endpoint
Type | Description |
---|---|
boolean | Whether or not authentication is required for this API Endpoint |
Execute the Endpoint Object, by sending the fully configured Request to the API Endpoint.
Type | Description |
---|---|
self | The current Endpoint Object for method chaining |
Get the options configured on the Endpoint
Type | Description |
---|---|
array | The options configured on the Endpoint Object |
Get the full URL being used by the Endpoint
Type | Description |
---|---|
string | The URL configured on the Endpoint Object |
Get the data URL being used by the Endpoint
Type | Description |
---|---|
array | The data configured on the Endpoint Object |
Get the Response Object being used by the Endpoint
Type | Description |
---|---|
SugarAPI\SDK\Response\Interfaces\ResponseInterface | The Response Object being used on the Endpoint Object |
Get the Request Object being used by the Endpoint
Type | Description |
---|---|
SugarAPI\SDK\Request\Interfaces\RequestInterface | The Request Object being used on the Endpoint Object |