I'm trying to convert my working Postman call with body:
{ "name": "my-template", "to": [ "subscriber1" ]}
to OpenAI generated Java-library code with the following Java-code:
public ApiClient getApiClient() {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath(novuAPIBasePath);
defaultClient.addDefaultHeader("Authorization", "ApiKey " + novuApiKey);
defaultClient.addDefaultHeader("Content-type", "application/json");
return defaultClient;
}
public TriggerEventResponseDto sendNotification(String fromSubId, String toSubId, String templateName) {
TriggerEventRequestDto triggerRequest = new TriggerEventRequestDto();
triggerRequest.setName(templateName);
triggerRequest.getTo().add(toSubId);
EventsApi eventsApi = new EventsApi(getApiClient());
TriggerEventResponseDto triggerResponseDto = eventsApi.eventsControllerTrackEvent(triggerRequest);
return triggerResponseDto;
}
My Postman call always returns:
{"data":{"acknowledged":true,"status":"processed","transactionId":"46a5f1f4-fe81-4e61-8ad6-ea9f323e5b44"}}
whereas my java-code (which I run from withing IntelliJ) always returns:
{"acknowledged":null,"status":null,"transactionId":null}
Does anybody see or knows whats wrong in the above (java)code and probably got a fix for this?!