Skip to content

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

@beshoo

Description

@beshoo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions