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

Images::imageAdInfo()   A

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
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