Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
beshoo opened this issue Aug 13, 2021 · 0 comments

Comments

@beshoo
Copy link

beshoo commented Aug 13, 2021

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' => 'restapi@example.com',
                '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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant