How can I get the product Id using a block app?

I’m creating a Shopify application, this application creates a block where:
The user can choose a product (I already have this integrated).
Once the user selects the product, I want to access its ID to be able to make a request like the one below.

How can I get the product ID?