Skip to content

Commit a45919d

Browse files
authored
Merge pull request #189 from controlshift/owens/369/update-petitions-event-api-with-social-media-message-settings
CON-369: Update Petitions and Events API with new social media message settings
2 parents fd988a3 + e816e88 commit a45919d

2 files changed

Lines changed: 75 additions & 5 deletions

File tree

source/includes/authenticated_api/_events.md.erb

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,17 @@ The authenticated REST API endpoints for events only deal with events created in
6464
"slug": "repair-the-yellow-brick-road-1",
6565
"url": "https://demo.controlshiftlabs.com/petitions/repair-the-yellow-brick-road-1"
6666
},
67-
"labels": ["oz-organizer-help"]
67+
"labels": ["oz-organizer-help"],
68+
"bluesky_share_message": "Join us at this event!",
69+
"facebook_share_description": "Come deliver the petition with us",
70+
"facebook_share_title": "Deliver the Petition to the Wizard",
71+
"meta_title": "Deliver the Petition to the Wizard - Event",
72+
"meta_description": "Join us as we travel to the Emerald City",
73+
"twitter_share_description": "Join us in the Emerald City!",
74+
"twitter_share_message": "Attending this event to deliver our petition",
75+
"twitter_share_title": "Deliver the Petition to the Wizard",
76+
"web_share_api_share_message": "Check out this event in the Emerald City",
77+
"whatsapp_share_message": "I'm attending this event to deliver the petition. Join me!"
6878
},
6979
...
7080
],
@@ -140,7 +150,17 @@ The response includes all the same data as the single-event endpoint for each ev
140150
"slug": "repair-the-yellow-brick-road-1",
141151
"url": "https://demo.controlshiftlabs.com/petitions/repair-the-yellow-brick-road-1"
142152
},
143-
"labels": ["oz-organizer-help"]
153+
"labels": ["oz-organizer-help"],
154+
"bluesky_share_message": "Join us at this event!",
155+
"facebook_share_description": "Come deliver the petition with us",
156+
"facebook_share_title": "Deliver the Petition to the Wizard",
157+
"meta_title": "Deliver the Petition to the Wizard - Event",
158+
"meta_description": "Join us as we travel to the Emerald City",
159+
"twitter_share_description": "Join us in the Emerald City!",
160+
"twitter_share_message": "Attending this event to deliver our petition",
161+
"twitter_share_title": "Deliver the Petition to the Wizard",
162+
"web_share_api_share_message": "Check out this event in the Emerald City",
163+
"whatsapp_share_message": "I'm attending this event to deliver the petition. Join me!"
144164
}
145165
}
146166
```
@@ -260,7 +280,17 @@ the event `slug` is `chapter-meeting-1`.
260280
"sharing_disabled": false,
261281
"web_conference_url": null,
262282
"mentor": null,
263-
"reviewer": null
283+
"reviewer": null,
284+
"bluesky_share_message": null,
285+
"facebook_share_description": null,
286+
"facebook_share_title": null,
287+
"meta_title": null,
288+
"meta_description": null,
289+
"twitter_share_description": null,
290+
"twitter_share_message": null,
291+
"twitter_share_title": null,
292+
"web_share_api_share_message": null,
293+
"whatsapp_share_message": null
264294
}
265295
}
266296
```
@@ -300,20 +330,30 @@ The fields that can be changed this way are:
300330

301331
Field | Type | Description
302332
------|------|------------
333+
bluesky_share_message | String | Custom message used when sharing the event on Bluesky
303334
campaigner_contactable | Boolean | Whether members of the public can contact the event host via the public event page
304335
description | String | Description of the event
305336
event_host_name_override | String | Name to display for the event host on the event page. Set to `null` to use the name from the event host's user account.
306337
extra_location_info | String | Additional non-address information about the event's location, e.g. "7th floor" or "Park in the back parking lot"
338+
facebook_share_description | String | Custom description used when sharing the event on Facebook
339+
facebook_share_title | String | Custom title used when sharing the event on Facebook
307340
forum_enabled | Boolean | Enables or disables the discussion forum feature for the event's attendees
308341
hidden_address | Boolean | Indicates that the event's address is private. The city/locality will be shown on the web, but the full address will only be provided to members who RSVP to the event.
309342
hide_recent_attendees | Boolean | Do not display the names of people who recently RSVPed in the post-RSVP sharing prompt.
310343
host_address | String | The mailing address of the event host. May be used to mail event materials.
311344
location_venue | String | Venue name. Only relevant for in-person events.
312345
max_attendees_count | Integer | Limit on how many people, besides the host, may sign up for this event. Set to `null` for no limit.
346+
meta_description | String | Custom meta description for the event page (used for SEO and social media previews)
347+
meta_title | String | Custom meta title for the event page (used for SEO and social media previews)
313348
redirect_to | String | If set, visitors to the event page will be redirected to this URL
314349
sharing_disabled | Boolean | Turns off the social sharing prompts for the event
315350
title | String | Event title
351+
twitter_share_description | String | Custom description used when sharing the event on Twitter/X
352+
twitter_share_message | String | Custom message used when sharing the event on Twitter/X
353+
twitter_share_title | String | Custom title used when sharing the event on Twitter/X
316354
web_conference_url | String | Video call or web conference tool URL for attendees to access the event
355+
web_share_api_share_message | String | Custom message used when sharing the event via the Web Share API
356+
whatsapp_share_message | String | Custom message used when sharing the event on WhatsApp
317357

318358
<div></div>
319359

source/includes/authenticated_api/_petitions.md.erb

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,17 @@ Petition are pieces of content that can be signed by members.
154154
"slug": "boats",
155155
"name": "Boats"
156156
}
157-
]
157+
],
158+
"bluesky_share_message": "Join us in supporting this petition!",
159+
"facebook_share_description": "Help us stop the taxation of tea",
160+
"facebook_share_title": "No Taxes on Tea",
161+
"meta_title": "No Taxes on Tea - ControlShift",
162+
"meta_description": "Sign our petition to stop tea taxation",
163+
"twitter_share_description": "Stop taxing our tea!",
164+
"twitter_share_message": "Sign this petition to end tea taxes",
165+
"twitter_share_title": "No Taxes on Tea",
166+
"web_share_api_share_message": "Check out this petition about tea taxes",
167+
"whatsapp_share_message": "I just signed a petition about tea taxes. Join me!"
158168
}
159169
}
160170
```
@@ -325,7 +335,17 @@ Get a paginated list of all petitions, including ones that are unlaunched or oth
325335
"slug": "end-colonialism-now",
326336
"title": "End Colonialism"
327337
}
328-
]
338+
],
339+
"bluesky_share_message": null,
340+
"facebook_share_description": null,
341+
"facebook_share_title": null,
342+
"meta_title": null,
343+
"meta_description": null,
344+
"twitter_share_description": null,
345+
"twitter_share_message": null,
346+
"twitter_share_title": null,
347+
"web_share_api_share_message": null,
348+
"whatsapp_share_message": null
329349
}
330350
}
331351
```
@@ -398,6 +418,7 @@ Field | Type | Description
398418
------|------|------------
399419
admin_events_status | String | Whether the petition creator can create events associated with the petition. Must be one of "on" (events can be created), "off" (events cannot be created), or "auto" (use the default setting based on moderation status and number of signatures).
400420
alias | String | Used for the petition's short URL. Setting `alias` to "foo" will result in a short URL of /p/foo
421+
bluesky_share_message | String | Custom message used when sharing the petition on Bluesky
401422
campaigner_contactable | Boolean | Whether members of the public can contact the petition creator via the public petition page
402423
can_download_signers | Boolean | Whether the petition creator can download information about petition signers
403424
categories_locked | Boolean | Petition creator cannot change which categories the petition is in
@@ -408,18 +429,27 @@ external_facebook_page | String | URL of a Facebook page associated with the pet
408429
external_facebook_page_locked | Boolean | Petition creator cannot change the Facebook page URL
409430
external_site | String | URL of a non-ControlShift page associated with the petition
410431
external_site_locked | Boolean | Petition creator cannot change the external site URL
432+
facebook_share_description | String | Custom description used when sharing the petition on Facebook
433+
facebook_share_title | String | Custom title used when sharing the petition on Facebook
411434
hide_petition_creator | Boolean | Do not display the petition creator's name or profile picture on the petition page
412435
hide_recent_signers | Boolean | Do not display the list of recent signers on the petition page
413436
hide_signature_form | Boolean | Turn off the form that allows people to sign the petition via the petition page
437+
meta_description | String | Custom meta description for the petition page (used for SEO and social media previews)
438+
meta_title | String | Custom meta title for the petition page (used for SEO and social media previews)
414439
partnerships | Array | List of partnerships this petition should be associated with, formatted like `[{"slug": "foo"}, {"slug": "bar"}]`. If the petition was associated with any partnerships that are not included in the list, it will be removed from those partnerships.
415440
petition_creator_name_override | String | Name to display for the petition creator on the petition page. Set to `null` to use the name from the petition creator's user account.
416441
redirect_to | String | If set, visitors to the petition page will be redirected to this URL
417442
show_progress_bar | Boolean | Whether to show the signature progress bar on the petition page
418443
signature_count_add_amount | Integer | If set, the displayed signature total on the petition page will be this much higher than the actual number of signatures recorded by the platform. This is usually used to reflect signatures that were gathered elsewhere and cannot be added to the platform, or signers whose data has been anonymized. A negative number can be specified to subtract from the total.
419444
title | String | Petition title
420445
title_locked | Boolean | Petition creator cannot change the title
446+
twitter_share_description | String | Custom description used when sharing the petition on Twitter/X
447+
twitter_share_message | String | Custom message used when sharing the petition on Twitter/X
448+
twitter_share_title | String | Custom title used when sharing the petition on Twitter/X
449+
web_share_api_share_message | String | Custom message used when sharing the petition via the Web Share API
421450
what | String | Petition text in HTML format
422451
what_locked | Boolean | Petition creator cannot change the "what" field
452+
whatsapp_share_message | String | Custom message used when sharing the petition on WhatsApp
423453
who | String | Name of the person this petition is targeting. Petitions associated with a decision maker will not necessarily use this setting.
424454
who_locked | Boolean | Petition creator cannot change the "who" field
425455
why | String | "Why is this important?" text in HTML format

0 commit comments

Comments
 (0)