PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
3.24.3 3.24.2 3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 All 107 releases
wp-parsely / src / services / content-api / endpoints / class-endpoint-analytics-post-details.php

class-endpoint-analytics-post-details.php in Parse.ly 3.24.2, at src/services/content-api/endpoints/class-endpoint-analytics-post-details.php

55 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Parse.ly Content API Endpoint: Analytics Post Details
4 *
5 * @package Parsely
6 * @since 3.17.0
7 */
8
9 declare(strict_types=1);
10
11 namespace Parsely\Services\Content_API\Endpoints;
12
13 use WP_Error;
14
15 /**
16 * The endpoint for the /analytics/post/detail API request.
17 *
18 * @since 3.17.0
19 *
20 * @link https://docs.parse.ly/api-analytics-endpoint/#2-get-analytics-post-detail
21 */
22 class Endpoint_Analytics_Post_Details extends Content_API_Base_Endpoint {
23 /**
24 * Returns the endpoint for the API request.
25 *
26 * @since 3.17.0
27 *
28 * @return string
29 */
30 public function get_endpoint(): string {
31 return '/analytics/post/detail';
32 }
33
34 /**
35 * Executes the API request.
36 *
37 * @since 3.17.0
38 *
39 * @param array<mixed> $args The arguments to pass to the API request.
40 * @return WP_Error|array<mixed> The response from the API request.
41 */
42 public function call( array $args = array() ) {
43 $query_args = array(
44 'url' => $args['url'],
45 'period_start' => $args['period_start'],
46 'period_end' => $args['period_end'],
47 );
48
49 // Filter out the empty values.
50 $query_args = array_filter( $query_args );
51
52 return $this->request( 'GET', $query_args );
53 }
54 }
55