(news())
Get News
package hello.world;
import com.benzinga.bzclient.Bzclient;
import com.benzinga.bzclient.models.operations.GetNewsRequest;
import com.benzinga.bzclient.models.operations.GetNewsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Bzclient sdk = Bzclient.builder()
.apiKeyAuth("<YOUR_API_KEY_HERE>")
.build();
GetNewsRequest req = GetNewsRequest.builder()
.build();
GetNewsResponse res = sdk.news().get()
.request(req)
.call();
if (res.twoHundredApplicationJsonApiNewsItems().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetNewsRequest |
✔️ |
The request object to use for the request. |
GetNewsResponse
Error Type |
Status Code |
Content Type |
models/errors/APIException |
4XX, 5XX |
*/* |
Get Removed News
package hello.world;
import com.benzinga.bzclient.Bzclient;
import com.benzinga.bzclient.models.operations.GetRemovedNewsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Bzclient sdk = Bzclient.builder()
.apiKeyAuth("<YOUR_API_KEY_HERE>")
.build();
GetRemovedNewsResponse res = sdk.news().getRemoved()
.updatedSince("<value>")
.pageSize(948405L)
.page(766235L)
.call();
if (res.twoHundredApplicationJsonApiNewsRemovedItems().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
updatedSince |
Optional<String> |
➖ |
Updated Since |
pageSize |
Optional<Long> |
➖ |
Page Size |
page |
Optional<Long> |
➖ |
Page |
GetRemovedNewsResponse
Error Type |
Status Code |
Content Type |
models/errors/APIException |
4XX, 5XX |
*/* |