EOL
EOL
PublisherAPI cURL HTTP client.
__construct(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $key, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $secret, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $endpoint)
Initialize variables needed in the communication with the API.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $key | API Key. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $secret | API Secret Key. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $endpoint | API endpoint URL. |
get(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path_args = array(), \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $data = array()) : object
Create GET request to a specified endpoint.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path | API endpoint path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path_args | Endpoint path arguments to replace tokens in the path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $data | Raw content of the request or associative array to pass to endpoints. |
Preprocessed structured object.
post(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path, \ChapterThree\AppleNewsAPI\PublisherAPI\(array) $path_args, \ChapterThree\AppleNewsAPI\PublisherAPI\(array) $data = array()) : object
Create POST request to a specified endpoint.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path | API endpoint path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $path_args | Endpoint path arguments to replace tokens in the path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $data | Associative array to pass to endpoints, with keys:
|
Preprocessed structured object.
delete(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path_args = array(), \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $data = array()) : object
Create DELETE request to a specified endpoint.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path | API endpoint path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path_args | Endpoint path arguments to replace tokens in the path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $data | Raw content of the request or associative array to pass to endpoints. |
Preprocessed structured object and returns 204 No Content on success, with no response body.
triggerError(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $message, \ChapterThree\AppleNewsAPI\PublisherAPI\(const) $message_type = E_USER_NOTICE)
Error handler.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $message | Error message to display. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(const) | $message_type | Predefined Constants |
hhmac(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $string, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $api_key_secret) : \ChapterThree\AppleNewsAPI\PublisherAPI\(string)
Generate HMAC cryptographic hash.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $string | Message to be hashed. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $api_key_secret | Shared secret key used for generating the HMAC. |
Authorization token used in the HTTP headers.
auth(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $string = '') : \ChapterThree\AppleNewsAPI\PublisherAPI\(string)
Create canonical version of the request as a byte-wise concatenation.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $string | String to concatenate (see POST method). |
HMAC cryptographic hash
initVars(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $method, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path, \ChapterThree\AppleNewsAPI\PublisherAPI\(array) $path_args, \ChapterThree\AppleNewsAPI\PublisherAPI\(array) $data)
Initialize variables needed to make a request.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $method | Request method (POST/GET/DELETE). |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path | Path to API endpoint. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $path_args | Endpoint path arguments to replace tokens in the path. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $data | Data to pass to the endpoint. |
request(\ChapterThree\AppleNewsAPI\PublisherAPI\(array|\ChapterThree\AppleNewsAPI\PublisherAPI\string) $data) : \ChapterThree\AppleNewsAPI\PublisherAPI\(object)
Create HTTP request.
\ChapterThree\AppleNewsAPI\PublisherAPI\(array|\ChapterThree\AppleNewsAPI\PublisherAPI\string) | $data | Raw content of the request or associative array to pass to endpoints. |
HTTP Response object.
response(\ChapterThree\AppleNewsAPI\PublisherAPI\(object) $response) : \ChapterThree\AppleNewsAPI\PublisherAPI\(object)
Preprocess HTTP response.
\ChapterThree\AppleNewsAPI\PublisherAPI\(object) | $response | Structured object. |
HTTP Response object.
onErrorResponse(\ChapterThree\AppleNewsAPI\PublisherAPI\(int) $error_code, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $error_message, \ChapterThree\AppleNewsAPI\PublisherAPI\(object) $response)
Callback for error HTTP response.
\ChapterThree\AppleNewsAPI\PublisherAPI\(int) | $error_code | HTTP status code. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $error_message | HTTP status message. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(object) | $response | Structured object. |
getFileInformation(\ChapterThree\AppleNewsAPI\PublisherAPI\(string) $path) : \ChapterThree\AppleNewsAPI\PublisherAPI\(array)
Get file information and its contents to upload.
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $path | Path to a file included in the POST request. |
Associative array. The array contains information about a file.
multipartPart(\ChapterThree\AppleNewsAPI\PublisherAPI\(array) $attributes, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $mimetype = null, \ChapterThree\AppleNewsAPI\PublisherAPI\(string) $contents = null) : \ChapterThree\AppleNewsAPI\PublisherAPI\(string)
Generate individual multipart data parts.
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $attributes | Associative array with information about each file (mimetype, filename, size). |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $mimetype | Multipart mime type. |
\ChapterThree\AppleNewsAPI\PublisherAPI\(string) | $contents | Contents of the multipart content chunk. |
Raw HTTP multipart chunk formatted according to the RFC.
multipartFinalize(\ChapterThree\AppleNewsAPI\PublisherAPI\(array) $multiparts = array()) : \ChapterThree\AppleNewsAPI\PublisherAPI\(string)
Finalize multipart data.
\ChapterThree\AppleNewsAPI\PublisherAPI\(array) | $multiparts | Multipart data with its headers. |
Raw HTTP multipart data formatted according to the RFC.