Git Product home page Git Product logo

Comments (3)

Fenrihr avatar Fenrihr commented on June 2, 2024 1

I couldn't resolve as a formula in a cell.

In order to implement it, I created a gs function that executes ImportJSONViaPost and assigned that function to a drawing.

function BYMA_CEDEARS() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var hoja   = spreadsheet.getSheetByName("cotizacion_byma_api");

  // clean destination sheet
  hoja.clear();

  Browser.msgBox("Comensando actualizacion");

  var res = ImportJSONViaPost(
      "https://open.bymadata.com.ar/vanoms-be-core/rest/api/bymadata/free/cedears",
      '{"excludeZeroPxAndQty":false,"T2":true,"T1":false,"T0":false,"Content-Type":"application/json"}',
      "contentType=application/json",null,'noInherit,rawHeaders,noTruncate'
    )

  var numRows = res.length;
  var numCols = res[0].length

  Logger.log("Se encontraron: "+numCols+" columnas y "+numRows+" tickets");
  
  var data = hoja.getRange(1, 1, numRows, numCols);

  // write values in destination sheet
  data.setValues(res);

  Browser.msgBox("Proceso Finalizado");
}

from importjson.

augur-akm avatar augur-akm commented on June 2, 2024

3 years later:
Here is the correct formula:
=ImportJSONViaPost("https://cex.io/api/price_stats/ETH/USD", "lastHours=24&maxRespArrSize=100")

from importjson.

Fenrihr avatar Fenrihr commented on June 2, 2024

Almost the same problem here!

URL = https://open.bymadata.com.ar/vanoms-be-core/rest/api/bymadata/free/negociable-obligations
POST body =

{
    "excludeZeroPxAndQty":true,
    "T2":true,
    "T1":false,
    "T0":false,
    "Content-Type":"application/json"
}

I have tried:

ImportJSONViaPost(
"https://open.bymadata.com.ar/vanoms-be-core/rest/api/bymadata/free/negociable-obligations";
"excludeZeroPxAndQty=true&T2=true&T1=false&T0=false&Content-Type='application/json'"
)

but i get the error Exception: Request failed for https://open.bymadata.com.ar returned code 415 (línea 220).

Also i tried:

=ImportJSONViaPost(
"https://open.bymadata.com.ar/vanoms-be-core/rest/api/bymadata/free/negociable-obligations";;
"excludeZeroPxAndQty=true,T2=true,T1=false,T0=false,Content-Type='application/json'"
)

but the script remain on "Loading..."

from importjson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.