@vandana.agrawal we will validate the issue from our end and will get back to you. In the meanwhile, could you quickly check if botkit is enabled at you bot. (Agent transfer or any event at bot kit)?
The API is dependent on the botkit as mentioned on the documentation.
*Note: This API is currently accessible only if BotKit SDK or Agent Transfer is enabled for a bot*