Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

PHP #14

Open
TheCosmonaut opened this issue Jul 23, 2015 · 7 comments
Open

PHP #14

TheCosmonaut opened this issue Jul 23, 2015 · 7 comments

Comments

@TheCosmonaut
Copy link

I'd love to see examples for PHP as well. All the PHP wrappers I've found are for v2.

@mmikeww
Copy link

mmikeww commented Jul 27, 2015

bump, me too

@Braunson
Copy link

👍 Same here. When will we see v3 PHP wrappers. I found this..

https://github.com/drewm/mailchimp-api/tree/api-v3

@toomuchpete
Copy link
Contributor

Hey folks -- no ETA on wrappers or examples at this time.

For our own internal access to APIv3, we only put a very thin layer around either Guzzle or PHP Requests and haven't really found a great need for a full-fledged library yet, and the engineers writing that code have found the Python examples sufficient to get started.

We will definitely have both wrappers and examples eventually, but there are a lot of things considerably higher on the priority list right now.

@tcgumus
Copy link

tcgumus commented Aug 22, 2015

For a basic PHP/cURL auth and respond request you can use this code below.

$username = "tcgumus"; //it can be anything
$password = "API KEY";
// create curl resource 
$ch = curl_init(); 
// set url 
curl_setopt($ch, CURLOPT_URL, "http://us10.api.mailchimp.com/3.0/"); //make sure your dc is correct
//return the transfer as a string 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
// $output contains the output string 
$output = curl_exec($ch); 
// close curl resource to free up system resources 
curl_close($ch);   
print_r($output);

@hugoreaction
Copy link

I have tried what @tcgumus has added above however I get no response at all . I have been attempting to follow MailChimp Docs however I don't know how to execute any of the stuff in the PHP. Any suggestions are welcome, thanks

@toomuchpete
Copy link
Contributor

Hi, @hugoreaction -- this is not a good place to get API support. You'll want to reach out to apihelp at mailchimp dot com if you're having trouble.

@nekhbet
Copy link

nekhbet commented Jan 21, 2016

I wrote a small example and will add functionality to it and make it public if anyone will approve the pull request: #25

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants