Auth
in package
Auth class for Epson Connect PHP.
This class handles the authentication process with the Epson Connect API. It includes methods for sending HTTP requests, authenticating and deauthenticating the client, and retrieving the device ID.
Table of Contents
- $_access_token : mixed
- $_expires_at : mixed
- $_refresh_token : mixed
- $_subject_id : mixed
- $_base_url : mixed
- $_client_id : mixed
- $_client_secret : mixed
- $_printer_email : mixed
- __construct() : mixed
- Class constructor.
- _deauthenticate() : mixed
- Deauthenticates the client.
- auth() : mixed
- Authenticates the client and retrieves the access token.
- default_headers() : array<string|int, mixed>
- Returns the default headers for requests.
- device_id() : string
- Returns the device ID.
- send() : array<string|int, mixed>
- Sends an HTTP request.
Properties
$_access_token
public
mixed
$_access_token
= ''
$_expires_at
public
mixed
$_expires_at
$_refresh_token
public
mixed
$_refresh_token
$_subject_id
public
mixed
$_subject_id
$_base_url
private
mixed
$_base_url
$_client_id
private
mixed
$_client_id
$_client_secret
private
mixed
$_client_secret
$_printer_email
private
mixed
$_printer_email
Methods
__construct()
Class constructor.
public
__construct(string $base_url, string $printer_email, string $client_id, string $client_secret) : mixed
Parameters
- $base_url : string
-
The base URL for the API.
- $printer_email : string
-
The email of the printer.
- $client_id : string
-
The client ID for the API.
- $client_secret : string
-
The client secret for the API.
Return values
mixed —_deauthenticate()
Deauthenticates the client.
public
_deauthenticate() : mixed
Return values
mixed —auth()
Authenticates the client and retrieves the access token.
public
auth() : mixed
Tags
Return values
mixed —default_headers()
Returns the default headers for requests.
public
default_headers() : array<string|int, mixed>
Return values
array<string|int, mixed> —The default headers.
device_id()
Returns the device ID.
public
device_id() : string
Return values
string —The device ID.
send()
Sends an HTTP request.
public
send(string $method, string $path[, array<string|int, mixed>|null $headers = null ][, mixed|null $data = null ]) : array<string|int, mixed>
Parameters
- $method : string
-
The HTTP method.
- $path : string
-
The path for the request.
- $headers : array<string|int, mixed>|null = null
-
The headers for the request.
- $data : mixed|null = null
-
The data for the request.
Tags
Return values
array<string|int, mixed> —The response from the server.