Can we hit Cumulocity APIs with bootstrap credentials of microservice

Uhhh this is way too complicated for what you wanted to achieve. It’s much easier.
See here for an example using restTemplate:

Just adapt that to the inventory API and you can freely define which headers are sent or not also you get the required credentials via the context service which can be autowired into your service:

private ContextService<MicroserviceCredentials> contextService;

headers.set("Authorization", contextService.getContext().toCumulocityCredentials().getAuthenticationString());
1 Like