Skip to main content
< VOLVER

Descripciรณn general

Operaciones disponibles

  • get - Obtener noticias
  • getRemoved - Obtener noticias eliminadas
Obtener noticias

Ejemplo de uso

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("<TU_CLAVE_API_AQUร>")
            .build();

        GetNewsRequest req = GetNewsRequest.builder()
                .build();

        GetNewsResponse res = sdk.news().get()
                .request(req)
                .call();

        if (res.twoHundredApplicationJsonApiNewsItems().isPresent()) {
            // handle response
        }
    }
}

Parรกmetros

ParรกmetroTipoObligatorioDescripciรณn
requestGetNewsRequest:heavy_check_mark:El objeto de solicitud que se utilizarรก.

Respuesta

GetNewsResponse

Errores

Tipo de errorCรณdigo de estado HTTPTipo de contenido
models/errors/APIException4XX, 5XX/

getRemoved

Obtener noticias eliminadas

Ejemplo de uso

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()) {
            // manejar la respuesta
        }
    }
}

Parรกmetros

ParรกmetroTipoObligatorioDescripciรณn
updatedSinceOptional<String>:heavy_minus_sign:Actualizado desde
pageSizeOptional<Long>:heavy_minus_sign:Tamaรฑo de pรกgina
pageOptional<Long>:heavy_minus_sign:Pรกgina

Respuesta

GetRemovedNewsResponse

Errores

Tipo de errorCรณdigo de estadoTipo de contenido
models/errors/APIException4XX, 5XX/