Home / Selections / create

Selections ‐ create


Description:

Create a selection

The following errors can occur:
- Token not present in request.
- Token not in the required format.
- Session does not exist.
- Session has expired.
- The user does not exist.
- No database specified.
- Database parameter not in correct format.
- You are not allowed to access this database.
- The email parameter is required.
- The email parameter is invalid.
- The selected subscriber does not exist.
- An id/list of ids are required.
- A name is required.
- The name parameter has the wrong format ([a-z0-9 _.@-]).
- The description parameter has the wrong format.

Example:

You should call this function as followed:
- rest/v2/selections/create?token=TOKEN&database=DATABASE_ID&name=STRING&description=STRING

                require_once 'Rest.php';

                $username = 'my_username';
                $password = 'my_password';
                $database = '999';

                $rest = new Rest($username, $password, $database);
                $result = $rest->call('selections/create', [
                	'name' => 'STRING',
'description' => 'STRING' ], 'GET'); var_dump($result);

Parameters:

The following parameters this method can be called with:

key: name
values: string, ([a-z0-9 _.@-]), required
what: The name of the new selection

key: description
values: string, not required
what: The description of the selection

See:

The following items:
- user/login For the TOKEN.
- user/database For the DATABASE_ID