API to populate meta_data
-
I’m testing the plugin and, in principle, it seems very versatile.
The only thing is that I’m trying to include data in the “meta_data” of each activation, and despite successfully activating the license and even filling out the “label” field, I can’t get the information I provide in JSON format for meta_data to be stored, always leaving it as null or empty.
In fact, looking at this page:
https://docs.codeverve.com/digital-license-manager/rest-api/licenses/activate/I see that what is passed in the PHP code as “mac” is not represented in the result shown on that same page, since [meta_data] => Array(), which, I understand, is an empty array.
Could you give me an idea or C# code that allows me to include data in this field?
Thanks in advance
The page I need help with: [log in to see the link]
-
Hey @asimancas
Looks like this is a typo on the Documentation site.
The correct argument for meta data would be meta not meta_data.
Sorry about that.
Best Regards,
DarkoYes, Darko, I’ve detected that “meta” should be used. Thank for your support.
I wanted to take advantage of your response to ask if there’s an API that allows to retrieve customer information (associated with a license key), such as first name, last name, email, and company.
It would be ideal to be able to display this information in programs that use your plugin.
Thanks again.Alfredo
Hey @asimancas –
There’s no built in route for this. As a workaround you can use the WordPress native route:your-site.com/wp-json/wp/v2/users/{the_user_ID}The
user_idproperty is the one you will use from theLicenseobject. This route is a public WordPress route that shows non-sensitive information about specific user.As you can see it shows user name and avatar.
Best Regards,
DarkoHello Darko,
Yes, I had considered that option, but I opted to create a filter to modify the plugin’s meta_data response and include the information there.
Thanks anyway.Regards,
Alfredo
Actually that’s better! You will save a call.
Best Regards,
Darko
The topic ‘API to populate meta_data’ is closed to new replies.