Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
blank gravity form entries with API

I'm trying to create an entry in a Gravity form via API post in Google Apps script.

An entry gets created but the values are showing blank. any insight of where I'm possibly going wrong would be appreciated.

Below is my code:

function gravityForms(){

const url = 'https://example.com/wp-json/gf/v2/forms/18/entries';

const payload = [{"2":"My name"}];

const options = {
    "method" : "post",
    "payload" : JSON.stringify(payload),
    "muteHttpExceptions" : true
  };
  
    options.headers = {    
    "Content-Type" : "application/json",
    "Authorization" : "Basic " + Utilities.base64Encode("ck_xxxxxxxxxxxx:cs_xxxxxxxxxxxxxxxxxx")
  };

const res = UrlFetchApp.fetch(url, options);

console.log(res.getContentText());

}

This is the response I get back in the logger

{"0":{"2":"My name"},"form_id":18,"id":3320}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I removed the [] from the entry object and it worked. funny since the examples show to add them.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!