Files
piratepoet/doc/api_methods/UpdateList.md
Jan Lysý 1ac9c86a66 Add updateList documentation
[MAILPOET-4752]
2022-11-02 14:05:39 +01:00

1.4 KiB
Raw Blame History

back to list

Add Subscriber

array updateList(array $list)

This method provides functionality for updating a list name or description.

It returns the updated list. See Get Lists for a list data structure description.

Arguments

$list (required)

An associative array which contains list data.

Property Type Limits Description
id (required) string 11 chars A id of the list.
name (required) string 90 chars A name of the list.
description (optional) string|null 250 chars A description of the list.

Error handling

All expected errors from the API are exceptions of class \MailPoet\API\MP\v1\APIException. Code of the exception is populated to distinguish between different errors.

An exception of base class \Exception can be thrown when something unexpected happens.

Codes description:

Code Description
5 The list was not found by id
14 Missing list name
15 Trying to use a list that is already used
18 Missing list id
19 The list couldnt be updated in the database