Posts: 10
Registered: ‎07-24-2014

New to integration - PHP cURL question

I am learning about working with integrating into my php application. Apparently I need to request and recieve a Token inorder to load a customer profile. I am not completely confident I have the right direction. Here's a cURL request I am trying:




$Authorization = "PaymentProfileId=" . $someknownprofileid;
$URLBase = "";


function curl_request($url, $postdata) //single custom cURL request.
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url . "?" . $postdata,

$response = curl_exec($ch);
if (!curl_exec($ch)) {
// if curl_exec() returned false and thus failed
echo '<br>An error has occurred: ' . curl_error($ch). '<br>';
else {
echo '<br>everything was successful<br>';

echo "<br>cURL Get Info returns : <br>";


return $response;

$data = curl_request($URLBase, $Authorization); //return cURL request to $data

//Display request result
echo "<br><br>cURL request returns : <br><br>";



 This returns a 'Missing or Invalid Token' message. Since I am requesting for a token, I'm not sure how to proceed. Is this refering to the ProfileId I am passing? Am I not passing it correctly? Is this cURL soution the wrong way to go about this?


Thanks in advance for any assistance!

Posts: 4,525
Registered: ‎03-08-2010

Re: New to integration - PHP cURL question

[ Edited ]

Is in the doc




And they have sample php code under the downloads. although there isn't one for getting the token