Establish the URL pattern for the REST route
The REST route is exposed under the following URL and default port value:
- Authenticated: https://localhost:8095/{tenantGuid}/ext/sample/...
- Unauthenticated: https://localhost:8095/{tenantGuid}/ext/open/sample/...
The
tenantGuid
is the SRP ID that is associated with the BlackBerry UEM
domain and was entered by the administrator when they installed the BlackBerry UEM
software. It is a unique identifier for the BlackBerry UEM
domain.When the administrator installs the first instance of
BlackBerry UEM
, by default, the installer tries to reserve port 8095 for REST communication for BlackBerry UEM
plug-ins. The database name of this port is tomcat.public.https.port
. If the default port value is not available, the installer assigns an available port value from the range of 12000 to 12999. For more information about BlackBerry UEM
listening ports, see “How BlackBerry UEM
selects listening ports during installation” in the BlackBerry UEM
Installation content. The topic "Check the ports assigned by the BlackBerry UEM
setup application" provides a script you can use to retrieve assigned port values from the UEM
database. You will need to add tomcat.public.https.port
to the script before you run it.The REST communication port uses a
BlackBerry
self-signed certificate. Any external system that wants to communicate over the REST route must trust this certificate to successfully make requests.An external system must provide an authentication header to invoke a plug-in’s authenticated REST route. The following
BlackBerry UEM
REST API utility method can be used to generate an authentication header: https://localhost:18084/{
. For more information about using this method to authenticate API calls, see the BlackBerry Web Services REST API Reference – Utilities, and Example: Request Authorization Header.tenantGuid
}/api/v1/util/authorizationAll controllers must:
- Be annotated with@Controller
- ExtendAbstractController
- Be annotated with@Pathand useAbstractController.PATH_PREFIX(authenticated) orAbstractController.OPEN_PATH_PREFIX(unauthenticated).
SampleController.java
@Controller @Path(AbstractController.PATH_PREFIX + "/sample") public class SampleController extends AbstractController { /** * Provides access to authentication utilities. * Any UEM services can be @Autowired into controllers */ @Autowired private AuthenticationUtil authenticationUtil;
SampleOpenController.java
@Controller @Path(AbstractController.OPEN_PATH_PREFIX + "/sample") public class SampleOpenController extends AbstractController {