Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mimeoconnect/900719 to your computer and use it in GitHub Desktop.

Select an option

Save mimeoconnect/900719 to your computer and use it in GitHub Desktop.
This creates a new address for a user.
<?php
require_once "rest_client.php";
//Sandbox
//$root_url = "connect.sandbox.mimeo.com/2010/09/";
$user_name = "[user name]";
$password = "[user password]";
//Live
$root_url = "connect.mimeo.com/2010/09/";
$user_name = "[user name]";
$password = "[user password]";
$rest = new RESTclient($root_url,$user_name,$password);
$inputs = array();
$inputs["Prefix"] = "Mr.";
$inputs["CompanyName"] = "Mimeo";
$inputs["FirstName"] = "John";
$inputs["LastName"] = "Doe";
$inputs["CareOf"] = "John Doe";
$inputs["Email"] = "info@mimeo.com";
$inputs["TelephoneNumber"] = "555-555-5555";
$inputs["Street"] = "460 Park Ave";
$inputs["ApartmentOrSuite"] = "1";
$inputs["City"] = "New York";
$inputs["StateOrProvince"] = "NY";
$inputs["PostalCode"] = "10016";
$inputs["Country"] = "US";
$url = "/AddressBookService/CreateAddress";
$rest->createRequest($url,"POST",$inputs);
$rest->setHeader("Content-Type","application/xml");
$rest->sendRequest();
$output = $rest->getResponseBody();
//echo $output;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment