Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

philfreo commented Jul 17, 2013

Assumes Requests is installed.

@wundo

This comment has been minimized.

Copy link

wundo commented Jan 12, 2015

Any plans on making a real PHP client/lib?

@philfreo

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.