Philippe Siguret
Philippe Siguret

Reputation: 11

POST request from Google Sheets to Norbert API

I have create automations with Zapier that get prospect informations and write it in new rows in a spreadsheet. This new sheet is composed by :

  • column A : name
  • Column B: domain

    I want to call an API that gets email : "Voilà Norbert" , and returns the email (or the error) into the Column C.

    The Norbert API works as follow:

    I have installed the importJSON code gist.github.com/chrislkeller/5719258 . I have tried to use the Zapier WebHook, it works, but I can't write the result in my spreadsheet. I have tried to use this script https://gist.github.com/mhawksey/1276293 in the google script, but it does not work because I don't know where to put the API URL that is need to be called.

    Do you know how to call a POST API with parameters in google spreadsheet that search the parameters into the spreadsheet, and that put the JSON result into the spreadsheet

    I'm not a developper (sadly). I think it could be useful for everybody that need to enrich their data into google spreadsheet using API call with parameters.

    Upvotes: 1

    Views: 7975

  • Answers (1)

    Alan Wells
    Alan Wells

    Reputation: 31310

    You have an Apps Script code bound to your spreadsheet. gs code runs on Google's Servers. In order to communicate with the Norbert API (Or any API), you must use the UrlFetchApp class.

    https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app

    And in particular, the fetch() method:

    https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)

    Upvotes: 0

    Related Questions