You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A request for an email with an apostrophe (') in it returned an error from Action Network
A lucky guess found that a two apostrophes ('') (as per mysql encapsulation) worked
Further reading on osdi found documentation that a single apostrophe in a search query needs to be escaped with another single apostrophe
My monkey patch
module ActionNetworkRest
class People < Base
def find_by_email(email)
# This works for parsing exactly 1 person's info out of the response.
# The response we get from Action Network is expected to have
#
# "_embedded": {
# "osdi:people": [{
# "identifiers": [
# "action_network:c947bcd0-929e-11e3-a2e9-12313d316c29"
# ....
# ]
# }]
# }
#
osdi_encoded_string = email.gsub("'","''")
url_encoded_filter_string = url_escape("email_address eq '#{osdi_encoded_string}'")
response = client.get_request "#{base_path}?filter=#{url_encoded_filter_string}"
person_object = response.body[:_embedded][osdi_key].first
set_action_network_id_on_object(person_object) if person_object.present?
end
end
end
The text was updated successfully, but these errors were encountered:
More lucky . . . went down a rabbit hole it was a mishandled sql issue until I read the oldie documentation
Which is kind of a compliment that the action network rest api gem is so good that I did not need to read the documentation
I also added some methods in people to get lists of signatures and tagging for a person - was pretty easy but suspect better to do using method missing and a list of such information sources
( which is provided in the people.list response )
I have a question as I am getting occasional strange response ( error responses ) from the signing of a petition
I know that signing fails is the address of the signing person is greater than 50 characters
- I thought it might have been certain characters so I removed / and ‘. That worked but it may have been an incidental shortening to less than 50 char
- I have also had problems with long person names
( not sure if its length of given plus family name or either )
I did not look methodically and just shortened a name so it worked
Action Network support were not very helpful and the error message - you have uncovered an error and we are looking into it is also unhelpful
Just wondering if you have any ideas how / where why to go about solving this
PS - the API is neat - I should dig deeper to see how it hangs together
M
A request for an email with an apostrophe (') in it returned an error from Action Network
A lucky guess found that a two apostrophes ('') (as per mysql encapsulation) worked
Further reading on osdi found documentation that a single apostrophe in a search query needs to be escaped with another single apostrophe
My monkey patch
module ActionNetworkRest
class People < Base
def find_by_email(email)
# This works for parsing exactly 1 person's info out of the response.
# The response we get from Action Network is expected to have
#
# "_embedded": {
# "osdi:people": [{
# "identifiers": [
# "action_network:c947bcd0-929e-11e3-a2e9-12313d316c29"
# ....
# ]
# }]
# }
#
osdi_encoded_string = email.gsub("'","''")
url_encoded_filter_string = url_escape("email_address eq '#{osdi_encoded_string}'")
response = client.get_request "#{base_path}?filter=#{url_encoded_filter_string}"
person_object = response.body[:_embedded][osdi_key].first
set_action_network_id_on_object(person_object) if person_object.present?
end
end
end
The text was updated successfully, but these errors were encountered: