Created
April 3, 2011 20:05
-
-
Save mimeoconnect/900719 to your computer and use it in GitHub Desktop.
This creates a new address for a user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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