Skip to main content
< 戻る

概要

利用可能な操作

  • get - ニュースを取得
  • getRemoved - 削除されたニュースを取得

get

ニュースの取得

使用例

package hello.world;

import java.lang.Exception;
import org.benzinga.BZClient.Bzclient;
import org.benzinga.BZClient.models.operations.GetNewsRequest;
import org.benzinga.BZClient.models.operations.GetNewsResponse;

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()) {
            // レスポンスを処理する
        }
    }
}

パラメータ

ParameterTypeRequiredDescription
requestGetNewsRequest:heavy_check_mark:このリクエストで使用するリクエストオブジェクト。

レスポンス

GetNewsResponse

エラー

エラー種別ステータスコードContent-Type
models/errors/APIException4XX, 5XX/

getRemoved

削除済みニュースを取得

使用例

package hello.world;

import java.lang.Exception;
import org.benzinga.BZClient.Bzclient;
import org.benzinga.BZClient.models.operations.GetRemovedNewsResponse;

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()) {
            // レスポンスを処理する
        }
    }
}

パラメータ

パラメータ名必須説明
updatedSinceOptional<String>:heavy_minus_sign:この日時以降の更新分を取得
pageSizeOptional<Long>:heavy_minus_sign:ページサイズ
pageOptional<Long>:heavy_minus_sign:ページ番号

レスポンス

GetRemovedNewsResponse

エラー

エラー種別ステータスコードコンテンツタイプ
models/errors/APIException4XX, 5XX/