subscribersDestroy method

Future<void> subscribersDestroy({
  1. String? ownerScreenName,
  2. String? ownerId,
  3. String? listId,
  4. String? slug,
})

Unsubscribes the authenticated user from the specified list.

ownerScreenName The screen name of the user who owns the list being requested by a slug.

ownerId The user ID of the user who owns the list being requested by a slug.

listId The numerical id of the list.

slug You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the ownerId or ownerScreenName parameters.

See https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy.

Implementation

Future<void> subscribersDestroy({
  String? ownerScreenName,
  String? ownerId,
  String? listId,
  String? slug,
}) async {
  final body = <String, String>{}
    ..addParameter('owner_screen_name', ownerScreenName)
    ..addParameter('owner_id', ownerId)
    ..addParameter('list_id', listId)
    ..addParameter('slug', slug);

  await client.post(
    Uri.https('api.twitter.com', '1.1/lists/subscribers/destroy.json'),
    body: body,
  );
}