Skip to content

Instantly share code, notes, and snippets.

@oknoorap oknoorap/test.md
Last active Aug 30, 2017

Embed
What would you like to do?
WordPress 4.8.1 Unknown SSL protocol error in connection to api.helpscout.net:443
$customer = array(
  'type' => 'customer',
  'email' => $customer_email
);

$fields = array(
	'mailbox' => array( 'id' => $mailbox_id ),
	'customer' => $customer,
	'subject' => $subject,
	'threads' => array(
		array(
		  'type' => 'customer',
		  'createdBy' => $customer,
		  'body' => $message,
		  'attachments' => $attachments
		)
	),
);

$fields = wp_json_encode( $fields );

wp_safe_remote_post( $this->api_url( 'conversations' ), array(
	'method' => 'POST',
	'timeout' => 45,
	'redirection' => 5,
	'blocking' => true,
	'sslverify' => false,
	'cookies' => array(),
	'headers' => array(
		'Accept' => 'application/json',
		'Content-Type' => 'application/json',
		'Content-Length' => strlen( $fields ),
		'Authorization' => 'Basic ' . base64_encode( $this->api_key . ':' . 'X' ),
	),
	'body' => $fields,
) );
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.