Consumption of URL https IBPT

Asked

Viewed 64 times

-1

I need to consume the new IBPT url to do tax calculations without importing tables.

The url is this : https://apidoni.ibpt.org.br/api/v1/products?token=..tMobi=un&valor=34000.00>in=sem gtin

Before I did just that and that’s it.

  HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
        httpConn.setConnectTimeout(connectionTimeOut);
        httpConn.setReadTimeout(readTimeOut);
        InputStream inputStream = httpConn.getInputStream();
        String retorno = IOUtils.toString(inputStream, "UTF-8");
        return retorno;

Now I have to create sockets? How is it done on the invoice?

Because if I try to connect to that url by this method gives error 404.

1 answer

0

The error was in the url, do not have to socket to IBPT queries. Just use a url encoding where there will be spaces, for example in the product description and in the "no gtin".

Ex: =Fiat%20Mobi%20Like%201.0%20CHASSI%209BD341A5XLY620671%20-%20QQS-4242&unitMeasured=un&value=34000.00&gtin=No%20Gtin

Browser other questions tagged

You are not signed in. Login or sign up in order to post.