How to Post data from external HTML form to Eloqua Form using cURL

323 Views Asked by At

I want to post data from an external HTML form to a simple form created in Eloqua, using cURL method. I tried to follow this documentation but I am not able to post data to Eloqua.

When I try from command line (Windows) -

curl --user "usercreds" --header "Content-Type: application/json" --request POST --data "{"testfirstname":"abc","testlastname":"def","singleCheckbox":1}" https://secure.p0{POD Number}.eloqua.com/api/REST/1.0/data/form/{formid}

I get below error:

[{"type":"ObjectValidationError","property":"fieldValues","requirement":{"type":"NoDuplicatesRequirement"},"value":""}]

When I try from PHP, as mentioned here https://www.eehelp.com/question/using-curl-to-repost-to-eloqua-data/ or https://github.com/fredsakr/eloqua-php-request the curl returns HTTP code 0.

This is a simple form created in Eloqua without any validations. I do not know what I am doing wrong here.

0

There are 0 best solutions below