rest-api icon indicating copy to clipboard operation
rest-api copied to clipboard

How can target a LIST when add a new subscriber via php , How can I add attributes to the JSON?

Open beshoo opened this issue 3 years ago • 0 comments

Dear All Am testing the Rest API, and it works great. The problem is how can I target a specific List. and how can I add the attributes to the json?

try {
    $subscriberRequest = $client->request('POST', $base_uri . '/subscribers',
        [
            'headers' => [
                'Authorization' => 'Basic ' . $credentials,
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'email' => '[email protected]',
                'confirmed' => true,
                'blacklisted' => false,
                'html_email' => true,
                'disabled' => false,
                
            ],
        ]
    );
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
}

I can found nothing in the API Doc https://github.com/phpList/rest-api/blob/master/docs/Api/RestApi.apib

beshoo avatar Aug 13 '21 22:08 beshoo