Hi
The webapi pack has a LimeLM.php file;however it does not have all the webapi functions. I am interested in limelm.pkey.advancedSearch
Thanks
Hi,
I am using the sample php file find-keys.php. I have confirmed that emails I enter are associated with more than one product keys. I keep getting message :"No product keys were found for this email address. Use the email you used when you purchased the product."
Can you please, have a look at it? I have supplied my api id and version string which is working fine for my payment example.
Here is the function call :
// if there's an email if (!empty($_POST['email'])) { $fields_valid = true;
try { // Find product keys using the email $xml = new SimpleXMLElement(LimeLM::FindPKey($version_id, $_POST['email']));
if ($xml['stat'] == 'ok') { // list the product keys foreach ($xml->pkeys->pkey as $pkey) { if ($pkeys) $pkeys .= "\r\n";
$pkeys .= $pkey['key']; }
$emailBody = 'Your product key'.($xml->pkeys['total'] > 1 ? 's are' : ' is').':
'.$pkeys;
// email the user their product keys $emailSent = mail($_POST['email'], 'Your product '.($xml->pkeys['total'] > 1 ? 'keys' : 'key'), $emailBody);
$success = true; } else //failure { $success = false;
if ($xml->err['code'] == '1') { // tell the user that no product key was found for that email $pkey_not_found = true; } else // something else went wrong { //TODO, log the error or email yourself $emailSent = mail('rrval@nytric.com', 'Error occurred', $xml->err['code'].' '.$xml->err['msg']); } } } catch (Exception $e) { $success = false;
//TODO: log the error } } else { $fields_valid = false; }
Hi
The webapi pack has a LimeLM.php file;however it does not have all the webapi functions. I am interested in limelm.pkey.advancedSearch
Thanks
Seems like api function limelm.pkey.find has a bug.
I was able to pull all of the keys with limelm.pkey.advancedSearch. Can you please, look into that ?
It doesn't have a bug. Make sure you're using the correct version_id, and the email you're passing in is correct.
Also, not that you shouldn't use the advancedSearch as a "drop in replacement" of pkey.find. Why? Because it will return all product keys if the "email" is left blank.
If you're still having trouble using limelm.pkey.find then you need to give us a lot more information. I.e. what you're passing in, errors you're getting, etc.
Hi Sam
I have tried all of my email and none of them returns anything. Here is the error code:[04/25/2016 8:42 AM] - FAILURE :Error code : 1[04/25/2016 8:42 AM] - FAILURE :Error code : 1
//////////No product keys found for the email address specified.//////////
I have checked several email addresses and all of them give me the same error with FindPKey. I have double check with the portal online. There is no scope for error in typing email as I used cut and paste. I tired manual method to input. None of them works.
I know about limelm.pkey.advancedSearch and I used it to prove that
1. All communication is okay2. Api key is correct3. Versionid is correct.
Hi Sam
Just missed important evidence. I was able to pull keys by email using Advancedsearch function. It proves that all my emails are also working fine.
Please, look into the findkey function. Thanks
The function works perfectly. We just checked. You need to provide:
1. Exactly what your input is.2. Exactly what the pkey.find response is (use print_r() to dump the output of that reponse.
SimpleXMLElement Object ( [@attributes] => Array ( [stat] => fail ) [err] => SimpleXMLElement Object ( [@attributes] => Array (
=> 1 [msg] => Product key not found. ) ) )
OK... and what's the input? Show me a snippet of code, and exactly what is in the variables.
---------------------------Response from advancedsearch------------------InputVersion ID :https://wyday.com/limelm/version/1779/Email :riddhesh_raval@yahoo.comResponseSimpleXMLElement Object ( [@attributes] => Array ( [stat] => ok ) [pkeys] => SimpleXMLElement Object ( [@attributes] => Array ( [pages] => 1 [total] => 4 ) [pkey] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 1405786 [key] => ***** [acts] => 1 [acts_used] => 0 [version_id] => 1779 [total_deacts] => 0 [deac_limit] => unlimited [for_tfs] => false [allow_vm] => no => riddhesh_raval@yahoo.com ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 1405089 [key] => ****** [acts] => 1 [acts_used] => 0 [version_id] => 1779 [total_deacts] => 0 [deac_limit] => unlimited [for_tfs] => false [allow_vm] => no [email] => riddhesh_raval@yahoo.com ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 1405088 [key] => ********** [acts] => 1 [acts_used] => 0 [version_id] => 1779 [total_deacts] => 0 [deac_limit] => unlimited [for_tfs] => false [allow_vm] => no [email] => riddhesh_raval@yahoo.com ) ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 1404916 [key] => ********* [acts] => 2 [acts_used] => 0 [version_id] => 1779 [total_deacts] => 0 [deac_limit] => unlimited [for_tfs] => false [allow_vm] => no [email] => riddhesh_raval@yahoo.com ) ) ) ) ) --------------------------------------------FindKey------------------------------------------InputVersion ID :https://wyday.com/limelm/version/1779/Email :riddhesh_raval@yahoo.comResponseSimpleXMLElement Object ( [@attributes] => Array ( [stat] => fail ) [err] => SimpleXMLElement Object ( [@attributes] => Array ( [code] => 1 [msg] => Product key not found. ) ) ) -------------------------------------------------------------Code----------------------------------FindKey--------------------------------------------------------$xml = new SimpleXMLElement(LimeLM::FindPKey($version_id, $_POST['email'])); ----------------------------------Advanced search--------------------------------------------------------$xml = new SimpleXMLElement(LimeLM::FindPKeyAll($version_id, $_POST['email'])); LimeLM function -------------public static function FindPKey($version_id, $email) { $post_data = array( 'method' => 'limelm.pkey.find', 'version_id' => $version_id, 'email' => $email ); return self::PostRequest($post_data); } public static function FindPKeyAll($version_id, $email) { $post_data = array( 'method' => 'limelm.pkey.advancedSearch', 'version_id' => $version_id, 'email' => $email ); return self::PostRequest($post_data); } Thanks
OK, both calls have the same problem: Version ID :https://wyday.com/limelm/version/1779/
That's not a proper version ID. A proper version ID is this: 1779
The reason the advancedSearch works with your incorrect input is that the advancedSearch function cleans the version ID variable differently than the pkey.find function. However, if you actually pass in the correct version ID then both functions will work.