cURL request formatting
Depending on the command line tool you use, the format in which you use cURL to make API requests will differ. See your command line tool below for the cURL syntax to use when making requests to Oracle Eloqua's APIs.
Bash
When using bash command line, format your cURL requests according to the following guidelines.
cURL option | Syntax | Example |
---|---|---|
--user | "<instanceName>\<userName>" | "APITest\API.User" |
--data | '{"<key>":"<value>"}' | '{"emailAddress":"george.washington@america.com"}' |
Syntax
curl --user "<instanceName>\<userName>" --header "Content-Type: application/json" --request POST --data '{"<key>":"<value>"}' https://secure.p0<podNumber>.eloqua.com/api/<apiType>/<apiVersion>/<endpoint>
Example
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"emailAddress":"george.washington@america.com"}' https://secure.p03.eloqua.com/api/REST/1.0/data/contact
Windows command line
When using Windows command line, format your cURL requests according to the following guidelines. Note that JSON must be serialized differently in windows command line compared to other command lines.
cURL option | Syntax | Example |
---|---|---|
--user | "<instanceName>\<userName>" | "APITest\API.User" |
--data | "{\"<key>\":\"<value>\"}" | "{\"emailAddress\":\"george.washington@america.com\"}" |
Syntax
curl --user "<instanceName>\<userName>" --header "Content-Type: application/json" --request POST --data "{\"<key>\":\"<value>\"}" https://secure.p0<podNumber>.eloqua.com/api/<apiType>/<apiVersion>/<endpoint>
Example
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data "{\"emailAddress\":\"george.washington@america.com\"}" https://secure.p03.eloqua.com/api/REST/1.0/data/contact
Terminal (macOS)
When using terminal, format your cURL requests according to the following guidelines.
cURL option | Syntax | Example |
---|---|---|
--user | "<instanceName>\\<userName>" | "APITest\\API.User" |
--data | '{"<key>":"<value>"}' | '{"emailAddress":"george.washington@america.com"}' |
Syntax
curl --user "<instanceName>\\<userName>" --header "Content-Type: application/json" --request POST --data '{"<key>":"<value>"}' https://secure.p0<podNumber>.eloqua.com/api/<apiType>/<apiVersion>/<endpoint>
Example
curl --user "APITest\\API.User" --header "Content-Type: application/json" --request POST --data '{"emailAddress":"george.washington@america.com"}' https://secure.p03.eloqua.com/api/REST/1.0/data/contact