Hello!
I am sure I use correct username & API. Still, I get this error:
Invalid username and/or API key. I can log in to YMLP, and I can see the api there. I use this same YMLP Account Username and API.
Ao, I am 100% sure they are correct.
What should I do to find what is wrong?
Pekka
]]>Hi I apologize for asking what is probably a stupid question but how do I map the Gravity Form fields to the YMLP, so they match and the feed will work?
Thanks for your help!
]]>Hi,
I installed the plugin and entered the YMLP credentials on the settings screen.
Then, I tried to add a new feed and got a strange warning within the Select a YMLP feed dropdown menu. The dropdown menu had two entries that looked something like:
Warning: Illegal string offset “GroupName” in … /ymlp/ymlp.php
Obviously, the actual YMLP group names were not displayed and when selecting one of the warning choices and then attempting to select a Gravity Form form from the next dropdown menu, nothing would happen. There would be just a circle spinning continously.
I verified the username and API key and they were correct (according to the client on behalf on which I was setting this up and who had provided them).
Now, I poked around the plugin code and found that somewhere around line 1259 of ymlp.php there is a call to get the list of groups via the api:
$lists = $api->GroupsGetList();
Then, there’s a check to see if there are no lists and if so to display the error:
if (!$lists){
echo __("Could not load YMLP contact lists. <br/>Error: ", "gravity-forms-ymlp");
echo isset($api->ErrorMessage) ? $api->ErrorMessage : '';
}
The, all the logic happens in the else of the above if (if there are indeed lists).
To troubleshoot it, I added a variable dump to understand the nature of $lists in my scenario and see what it contained, if anything (this was added on line 1260, right after the call to list the groups:
echo "<pre>";
print_r($lists);
echo "</pre>";
This resulted in the following being displayed in the add new feed screen:
Array
(
[Code] => 101
[Output] => API access is disabled. To enable it, select API under the Configuration tab in your account.
)
So that means that if the plugin is unable to get the lists via the api (like in this example when API access is disabled in the YMLP account), the $lists variable/array will not be empty.
Thus, the check “if (!$lists){” will in fact be ignored (because the array is not empty) and the “else” be executed, except that there are no actual lists to display and the result will be the unfriendly illegal string offset warning.
Now, I was able to access the actual YMLP account in question and verify that indeed API access was not enabled (although the API key was displayed in the API section). Enabling the API access in the YMLP account fixed the issues I was having, but I would have had no idea this was the cause of everything had I not gone through this entire process.
As a regular user, I would have simply assumed that this is a bad/broken/incompatible plugin and uninstalled it immediately.
It would be great if you could correct the plugin to also check if $lists may not empty but instead contain an error message. Something like:
} elseif ($lists[Code]) { //check for failure code
echo "Error: " . $lists[Output]; //display the failure message
}
According to the YMLP documentation, the following is returned in case of failure for the Groups.GetList() api call:
Failure:
Returncode 100 : "Invalid or missing API key"
Returncode 101 : "API access is disabled"
Returncode 102 : "API access not allowed from this IP address ([IP])"
Hope this helps and thank you for this useful plugin.
]]>Hi,
I have installed Gravity Forms and the YMLP add-on and am experimenting with my first feed. It all seems to work like a charm except I am missing one essential piece of functionality that YMLP forms offer and I can’t see how to set it up through the forms feed.
It is regarding the ability to have a user select a group or groups in a form. We use this functionality to have a user select to be part of the “newsletter group” yes or no.
In YMLP it is the 3rd section in forms design (I have it in dutch and don’t know what it looks like in english) after the fields and hidden fields sections.
I attach a printscreen: https://screencast.com/t/hpeoGQC24k
Looking forward to your response and a big thumbs up for the add-on already!
]]>