Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8734735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:54:17+00:00 2026-06-13T09:54:17+00:00

This is one of my first curls code, so it can have mistakes I’m

  • 0

This is one of my first curls code, so it can have mistakes

I’m trying to be able to make calls to form/:id/submissions
https://www.formstack.com/developers/api/resources/submission#form/:id/submission_GET

If I load:

https://www.formstack.com/api/v2/form/1311091/submission.json?oauth_token=abc&min_time=2012-09-01%2000:01:01&max_time=2012-10-27%2000:01:01

If works great.

If I try this code:

 <?php    
 $host = 'https://www.formstack.com/api/v2/';

  // TODO this should manage dinamics values or build an action in every method. 
  $action = 'form/1311091/submission.json';

  $url = $host . $action;

  // TODO this values will arrive like an array with values
    $postData['oauth_token']= 'abc';
    $postData['min_time'] ='2012-09-01 00:01:01';
    $postData['max_time'] ='2012-10-27 00:01:01';

// TODO make a method with this action
function getElements($postData)
{

    $elements = array();  
    foreach ($postData as $name=>$value) {  
       $elements[] = "{$name}=".urlencode($value);  
    } 
}


  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_HTTPGET, true);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $elements);
  $result =  curl_exec($curl) ;
  curl_close($curl);
  var_dump($result);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:54:18+00:00Added an answer on June 13, 2026 at 9:54 am

    You’ll need to set:

    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    

    As an option before curl_exec() if you wish to get data back.

    CURLOPT_RETURNTRANSFER: TRUE to return the transfer as a string of the
    return value of curl_exec() instead of outputting it out directly.

    Also, why are you trying to send POST data via a GET request?

    CURLOPT_POSTFIELDS: The full data to post in a HTTP “POST” operation.

    Also, for debugging, you should check out:

    echo curl_error ( $curl );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Racking my brains on this one. I have the code below: the first stages
I can't figure this one out. At first let me say that my cache
I have two arrays the first one has this structure Parameter Keys array array
So this was one of my very first questions here, but I have a
I have two singletons, the first one's header looks like this (I've omitted everything
need a little help with this one. I have a form that I am
This one is a huge issue: first off, while I know a little bit
First of all I did gave a look at this one. But I didn't
I'm following a bioinformatics text, and this represents one of my first Perl scripts.
This is my second question on Bamboo ( My First One ). My understanding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.