GET /soa/petition_ads/:id
(id
is the lead-in petition id)
additional params:
- (required)
context=after_sign_sponsored
- (required)
locale
- (required)
country_code
- (optional)
include_phone_upsells
(only ifphone_petition
is not in the user’s request) - (optional)
source=fe-services-app
- (optional)
is_mobile
- (optional)
alert_id
required cookies:
_change_session
(there must be a session for an identified user (Rails gets the session via cookies)
items
will be an array of ads, including either:
-
an array of sponsored petition ads followed by a redirect ad to redirect the user to
finish_petition_upsells_url(petition_id: originating_petition.id)
-
a single redirect ad to either:
/p
(petitions_path) if
- user not identified
- no previous signature
- no lead-in petition found (missing or incorrect petition_id param)
OTHER DESTINATIONS per upsell_list_redirect
items: [
ad_type: petition.ad_type
petition_id: petition.id
lead_in_petition_id: originating_petition.id
sign_url: [SEE NOTE BELOW]
skip_url: [SEE NOTE BELOW]
prompt_record_id: prompt_record.try(:id)
title: prompted_petition_title(petition, mvtp)
has_mvtp_description: (boolean)
original_description: petition.description
description: prompted_petition_description(petition, mvtp, nil) # nil = don’t truncate
html_formatted_letter: petition.html_formatted_letter
photo_url: petition_photo_image_tag(:column_9) # SIZE: 556x313
photo_alt_title: # new helper reusing petition_photo_image_tag(:column_3, petition, :alt => petition.widget_title, :class => 'petition-image', :url_options => {:mvtp => mvtp})
displayed_signature_count: petition.displayed_signature_count
optin_text: petition_optin_text(petition, :include_name => true)
sign_button_text: sign_button_text(petition)[0]
signing_button_text: sign_button_text(petition)[1]
phone_number_placeholder: I18n::PhoneNumberValidator.placeholder
client_commitment:
id: petition.client_commitment.id,
name: petition.client_commitment.name
dollar_value: petition.dollar_value || -1.0
dollar_status: petition.dollar_status || "unavailable"
targeting_type: UserTargetingCondition.upsell_targeting_type(petition)
organization:
id: petition.organization_id
name: petition.organization.name
logo_url: place_organization_logo(petition) # 44x44 (exisiting organization :column_1 size)
]
NOTES:
- if
has_mvtp_description
is true, thendescription
is the MVT description. Otherwise, it is the petition’s description. sign_url
andskip_url
are not used by Rendr, as we chose to add routes to itsservices-app
that form the required URLs. Also note thatskip_url
used to include aprompt_record_id
param but that is no longer used after this commit.
items: [
ad_type: 'redirect'
redirect_to: (either `/p` or whatever `upsell_list_redirect` specifies)
]
Rendr will set the cookies
cookies["prompted_petitions"] = { value: 'true', expires: 12.hours.from_now, domain: base_domain }
cookies["phone_petition"] = { :value => 'true', :expires => 30.days.from_now, :domain => base_domain }