phpfui / ConstantContact

MIT License
16 stars 7 forks source link

ContactList returns nothing #6

Closed degive closed 2 years ago

degive commented 2 years ago

I followed your example, but when I do $listEndPoint = new \PHPFUI\ConstantContact\V3\ContactLists($client);

Nothing is returned, yet I have lots of lists.

Any idea why?

Thank you.

Michel

phpfui commented 2 years ago

This is a more complete example.

try
                {
                $contactListsAPI = new \PHPFUI\ConstantContact\V3\ContactLists($client);
                $response = $contactListsAPI->get();

                if (! $contactListsAPI->success())
                    {
                    WriteDebug($contactListsAPI->getStatusCode(), $contactListsAPI->getLastError());
                    }

                foreach ($response['lists'] ?? [] as $row)
                    {
                    // Do something with $row
                    }
                }
            catch (\Throwable $e)
                {
                WriteDebug($e);
                }
degive commented 2 years ago

Thank you. This works!