Images::imageAdInfo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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