Hi,
SCOM 2012 R2 does not have a REST API, SCOM 1807 (which is no longer supported) and above versions such as SCOM 2019 has REST API which you may use.
Integrating Java with SCOM Microsoft monitoring system, the information that can be obtained is very limited, only a few official document addresses:
Operations Manager REST API Reference - Operations Manager REST API | Microsoft Learn
SCOM: Quick Start - REST API - TechNet Articles - TechNet Wiki (microsoft.com)