Skip to content

Instantly share code, notes, and snippets.

@ArionHardison
Created October 9, 2014 20:04
Show Gist options
  • Save ArionHardison/11b84c94fd8f51d460de to your computer and use it in GitHub Desktop.
Save ArionHardison/11b84c94fd8f51d460de to your computer and use it in GitHub Desktop.
<?php
$url ="https://arion.nationbuilder.com/api/v1/imports?access_token=d80bd609b7634d77fb6f38a444cfb093da6c596c98b49fc0099ff8864e30d8b8";
$data = array(
"import" => array(
"file" => "aWQsZmlyc3RfbmFtZSxsYXN0X25hbWUNCjEsQnlyb24sQW5kZXJzb24",
"type" => "people",
"is_overwritable" => true
)
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_TIMEOUT, '10');
curl_setopt($ch, CURLOPT_HTTPHEADER,
array("Content-Type: application/json","Accept: application/json"));
$json_data = json_encode($data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
$json_response = curl_exec($ch);
curl_close($ch);
$response = json_decode($json_response, true);
print_r($response);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment