Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created October 25, 2017 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/453a96ce51ab23f3122a0a2f6596fa96 to your computer and use it in GitHub Desktop.
Save phpfiddle/453a96ce51ab23f3122a0a2f6596fa96 to your computer and use it in GitHub Desktop.
[ Posted by Ravi Duvvuri ] shopvox API login
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.shopvox.com/v1/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n\t\"user\": \"rduvvuri@gmail.com\",\n\t\"password\": \"test123\"\n}",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment