BUG: limelm.pkey.find Finds Keys outside VersionID ScopeSolved

I have the following setup:

Two Versions in LimeLM:

1) V1, with VersionID: VID1, 1 License Key: K12) V2, with VersionID: VID2, 1 License Key: K2

Now I call "limelm.pkey.find" via the Example in the C# example

(Method is Declared as FindPKey(string versionID, string email) in the C# Example: Method source listed below

FindPKey("VID1", "K2"); // K2 Does NOT exist for VID1

According to the Docs at: https://wyday.com/limelm/help/api/limelm.pkey.find/, email can be the Key to find.

FindPKey then finds the key K2 which is created for V2 with VersionID: VID2 !

This seems to be wrong, and will create problem for me when I later do need to support several versions.

----------- C# Source Code for FindPKey -----------------------

private static string DoFindPKey(string versionID, string email) { List<KeyValuePair<string, object>> postData = new List<KeyValuePair<string, object>> { new KeyValuePair<string, object>("method", "limelm.pkey.find"), new KeyValuePair<string, object>("version_id", versionID), new KeyValuePair<string, object>("email", email) };

return PostRequest(postData); }

, edited

Hello,

The same problem also exits for "limelm.pkey.getID"

In the C# Example it is declared as:public static string GetPKeyID(string version_id, string pkey)

GetPKeyID("VID1", "K2"); // K2 Does NOT exist for VID1

returns the "pKeyId" for K2, which does not exist for Version VID1, but does exist for Version "VID1".

This problem makes it difficult to know what API calls to trust, and makes programming difficult.We can start using Custom Field, but then we will have to perform a time consuming iterate over a lot of keys, as sales increase, to decide if a License Key is valid for a particular version!

Will this be fixed in the near future?

Several years ago we removed the version_id parameter from those functions when you pass in a product key. The documentation wasn't updated to reflect that. We'll fix that. If you pass in an email, the function does search *just* the version_id you pass in.

To recap:

1. If you use limelm.pkey.getID, it correctly finds product keys in your entire account. The documentation correctly reflects that.

2. If you use limelm.pkey.find with an email, it will correctly search within the version id you provide.

3. If you use limelm.pkey.find with a product key, it will search your whole account for the key.

@Wyatt,

I see you assigned [Solved] to this issue, while I thought it was me that should consider it solved....Your answer confuses me even more:

1) What parameters should I pass to "limelm.pkey.getID" ?

2) What parameters does "limelm.pkey.find" take ?

And finally: How do I Find if a License Key belongs to particular Version ID? NI do NOT think it is wise to use email as a unique Identifier, as some people change email addresses several times!

>> "1) What parameters should I pass to "limelm.pkey.getID" ? "

All of our web API functions, with the parameters to each is listed here: https://wyday.com/limelm/help/api/

limelm.pkey.getID: https://wyday.com/limelm/help/api/limelm.pkey.getID/

Notice how it doesn't require a version id (it did at one point in the past, but it was redundant, and thus removed).

>> "2) What parameters does "limelm.pkey.find" take ?"

https://wyday.com/limelm/help/api/limelm.pkey.find/

>> "And finally: How do I Find if a License Key belongs to particular Version ID?"

Take the extra step of getting the details for any product key you find: https://wyday.com/limelm/help/api/limelm.pkey.getDetails/

>> "I do NOT think it is wise to use email as a unique Identifier, as some people change email addresses several times!"

I agree. The product key is a good unique identifier (by virtue of the fact that it's unique). Or you can use any other identifier you can think of and use custom license fields and the advancedSearch function:

https://wyday.com/limelm/help/api/limelm.pkey.advancedSearch/

https://wyday.com/limelm/help/license-features/

@Wyatt

Quote:**************GOS: "And finally: How do I Find if a License Key belongs to particular Version ID?"

WyattTake the extra step of getting the details for any product key you find: https://wyday.com/limelm/help/api/limelm.pkey.getDetails/***********

Yes, I have thought of that, but if I have success with my product, thousands of keys may be returned:This may take a long time an be very inefficient!

It must be better do let the LimeLM database do what databases are good at: Looking up an Index Key:

What If I use the License, as you suggest as the "email": Then I can use limelm.pkey.find.

Q: Would that be effective?

I see now where confusion occurs: The Help at https://wyday.com/limelm/help/api states: that limelm.pkey.find takes 3 required parameters:

api_key (Required) , version_id (Required), email (Required)

but the C# Example code takes two:

Q: I guess I have to change this method.........

public static string FindPKey(string versionID, string email) { List<KeyValuePair<string, object>> postData = new List<KeyValuePair<string, object>> { new KeyValuePair<string, object>("method", "limelm.pkey.find"), new KeyValuePair<string, object>("version_id", versionID), new KeyValuePair<string, object>("email", email) };

return PostRequest(postData); }

>> "Q: Would that be effective?"

It depends on what you're trying to do. Can you tell me what problem you're trying to solve, and maybe I can give you more useful help.

>> 'Q: I guess I have to change this method........."

No, our pre-built C#/PHP/VB.NET/etc. examples already pass the api_key with every single web API request (because it's required by every API request).

@Wyatt,

I am trying to decide if a customer is eligible for an upgrade.

In LimeLM I create a new LimeLM Version for every Major version number: 1.x , 2.x etc.I also support three different Types of my Application: Basic, Standard and Pro: That is done via a Custom Field.The Customer can Upgrade, within a Major Version, from e.g. 1.x Basic to 1.x Pro, but not from 1.x Basic to 2.x !

Thus, when a Customer wants to upgrade, he enters his existing License Key in a Field, and Clicks a "Check Upgrade" Button:

I then want to check if the License exists within a particular LimeLM Version.

You can see my Buy Page Here: (work in progress)https://objective.no/vcasde10_Buy/payment.aspx

From your first answer:

<<2. If you use limelm.pkey.find with an email, it will correctly search within the version id you provide.>>

**** But that's exactly what I did in the example in my First Post above, and it searched through ALL LimeLM Versions, and not only the one indicated by the version_id parameter! *****