Skip to main content
< 뒤로 가기

개요

사용 가능한 작업

  • get - 뉴스 가져오기
  • getRemoved - 삭제된 뉴스 가져오기

가져오기

뉴스 가져오기

사용 예시

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()) {
            // 응답 처리
        }
    }
}

매개변수

매개변수유형필수설명
requestGetNewsRequest:heavy_check_mark:요청에 사용할 객체입니다.

응답

GetNewsResponse

오류

오류 유형상태 코드콘텐츠 타입
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()) {
            // 응답 처리
        }
    }
}

매개변수

ParameterTypeRequiredDescription
updatedSinceOptional<String>:heavy_minus_sign:지정 시각 이후 업데이트
pageSizeOptional<Long>:heavy_minus_sign:페이지 크기
pageOptional<Long>:heavy_minus_sign:페이지

응답

GetRemovedNewsResponse

오류

Error Type상태 코드콘텐츠 유형
models/errors/APIException4XX, 5XX/