How to create customer access token by id for REST api Magento 2?

Generate Customer token for the REST API using customer id in Magento 2 used to call Magento Service API.

If you have customer id, retrieve the token by the Token factory class of the Integration module.

Instantiate the Magento\Integration\Model\Oauth\TokenFactory in your class constructor method.

Call method by required input,