Passed
Push — master ( b8b318...ae3161 )
by Dmitry
13:51
created

Images   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
c 1
b 0
f 0
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A imageAdInfo() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Promopult\TikTokMarketingApi\Service;
6
7
use Promopult\TikTokMarketingApi\AbstractService;
8
9
final class Images extends AbstractService
10
{
11
    /**
12
     * Get image info
13
     *
14
     * You can obtain the information of a specific image from the material library of the Tiktok auction platform wtih
15
     * a GET request to the /file/image/ad/info/ endpoint.
16
     *
17
     * @param int $advertiserId     Advertiser ID
18
     * @param array $imageIds       Image ID list. Up to 100 ids per request
19
     *
20
     * @return array
21
     *
22
     * @throws \Throwable
23
     *
24
     * @see https://ads.tiktok.com/marketing_api/docs?id=1709478149999618
25
     */
26
    public function imageAdInfo(
27
        int $advertiserId,
28
        array $imageIds
29
    ): array {
30
        return $this->requestApi(
31
            'GET',
32
            '/open_api/v1.2/file/image/ad/info/',
33
            [
34
                'advertiser_id' => $advertiserId,
35
                'image_ids' => $imageIds
36
            ]
37
        );
38
    }
39
}
40