<commit_before><?php

//prints each recipient email addresses associated for delivery failures
//
//replace the following constant **** values with your own
define("ACCOUNT_ID", "9999");
define("API_USER", "user");
define("API_PASSWORD", "<PASSWORD>");

//calls messagesFailed
$service_url = 'https://api.socketlabs.com/messagesFailed?accountId=' . ACCOUNT_ID . '&type=xml';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERPWD, API_USER . ':' . API_PASSWORD);
$curl_response = curl_exec($curl);
curl_close($curl);

//parses XML response and outputs the email addresses of associated with each failure
$xml = new SimpleXMLElement($curl_response);
echo $xml->count[0] . ' records returned:<br/>';
<commit_msg>update PHP sample to use correct v1 address and serverId param.<commit_after><?php

//prints each recipient email addresses associated for delivery failures
//
//replace the following constant **** values with your own
define("SERVER_ID", "9999");
define("API_USER", "user");
define("API_PASSWORD", "<PASSWORD>");

//calls messagesFailed
$service_url = 'https://api.socketlabs.com/v1/messagesFailed?serverId=' . SERVER_ID . '&type=xml';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERPWD, API_USER . ':' . API_PASSWORD);
$curl_response = curl_exec($curl);
curl_close($curl);

//parses XML response and outputs the email addresses of associated with each failure
$xml = new SimpleXMLElement($curl_response);
echo $xml->count[0] . ' records returned:<br/>';

{'fraction_non_alphanumeric': 0.14661654135338345, 'fraction_numerical': 0.007518796992481203, 'mean_word_length': 6.497652582159624, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3562776', 'n_tokens_mistral': 519, 'n_tokens_neox': 488, 'n_words': 134}