Skip to content

Instantly share code, notes, and snippets.

@philfreo
Last active March 18, 2019 14:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philfreo/5406540 to your computer and use it in GitHub Desktop.
Save philfreo/5406540 to your computer and use it in GitHub Desktop.
POST HTTP request with JSON in PHP
$lead = array('name' => 'test');
$headers = array('Content-Type' => 'application/json');
$options = array('auth' => array('YOUR_API_KEY', ''));
$request = Requests::post('https://api.close.com/api/v1/lead/', $headers, json_encode($lead), $options);
@philfreo
Copy link
Author

Assumes Requests is installed.

@wundo
Copy link

wundo commented Jan 12, 2015

Any plans on making a real PHP client/lib?

@philfreo
Copy link
Author

philfreo commented Apr 7, 2015

We aren't currently working on official per-language client libraries but there are 2 unofficial libraries you can check out, if you want something beyond a simple REST wrapper:

https://github.com/loopline-systems/closeio-api-wrapper
https://github.com/TheDeveloper/closeio-php-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment