I can’t update the Full Description (not to be confused with the event summary) section of an event via their api. Their documentation seems pretty straightforward, however, it keeps returning a 200, but it doesn’t update the page version number or modules. Any help would be greatly appreciated.
Relevant Documentation: Doc 1 Doc 2
function addingEventDescription(eventId, currentEventDescription) {
const data = {
"modules":[
{
"type":"text",
"data":{
"body":{
"type":"text",
"text":"this is some fancy text",
"alignment":"left"
}
}
},
{
"type":"video",
"data":{
"video":{
"url":"https://www.youtube.com/watch?v=-pAz5X7ZW4",
"display_size":"large"
}
}
}
],
"publish":true,
"purpose":"listing"
};
// This must be incremented each time the event description is updated
const url = `https://www.eventbriteapi.com/v3/events/${eventId}/structured_content/${currentEventDescription+1}`
const options = {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(data),
muteHttpExceptions: true,
headers: {
"Authorization": `Bearer ${eventBriteToken}`
}
};
const response = UrlFetchApp.fetch(url, options);
const statusCode = response.getResponseCode();
const content = JSON.parse(response.getContentText())
if (statusCode != 200) {
throw Error(`${statusCode} on ${url}n${content.error}::${content.error_description}`)
}
return content;
}
addingEventDescription(980418226307,5)
In case it’s helpful this is the response when I request the current full event description via the https://www.eventbriteapi.com/v3/events/${eventId}/structured_content/
endpoint:
{
"resource_uris": {
"self": "https://www.eventbriteapi.com/v3/events/980418226307/structured_content/5/",
"add_module": "https://www.eventbriteapi.com/v3/events/980418226307/structured_content/5/module/",
"publish": "https://www.eventbriteapi.com/v3/events/980418226307/structured_content/5/publish/",
"preview_module": "https://www.eventbriteapi.com/v3/events/structured_content/module/preview/"
},
"access_type": "not-apply",
"has_autogenerated_content": false,
"hide_virtual_venue_content": false,
"page_version_number": "5",
"purpose": "listing",
"modules": [
{
"resource_uris": {
"self": "module/1541023419/"
},
"id": "1541023419",
"type": "text",
"layout": null,
"data": {
"body": {
"text": "<p>Totes magotes like the best description evah</p>",
"alignment": "left"
},
"display_restrictions": []
},
"semantic_purpose": "",
"timed_display": null,
"display_restrictions": []
},
{
"resource_uris": {
"self": "module/1541023429/"
},
"id": "1541023429",
"type": "video",
"layout": null,
"data": {
"display_restrictions": [],
"video": {
"url": "https://www.youtube.com/watch?v=uom6RoyqFiE",
"thumbnail_url": "https://i.ytimg.com/vi/uom6RoyqFiE/default.jpg",
"embed_url": "https://www.youtube.com/embed/uom6RoyqFiE/"
}
},
"semantic_purpose": "",
"timed_display": null,
"display_restrictions": []
},
{
"resource_uris": {
"self": "module/1541023439/"
},
"id": "1541023439",
"type": "image",
"layout": null,
"data": {
"display_restrictions": [],
"image": {
"edge_color_set": true,
"edge_color": "#ffffff",
"corner_style": "rectangular",
"url": "https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F822591399%2F52659637074%2F1%2Foriginal.20240807-193203?h=740&w=1200&auto=format%2Ccompress&q=75&sharp=10&s=616401026e53f08fb313d0de17fa8e76",
"original": {
"url": "https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F822591399%2F52659637074%2F1%2Foriginal.20240807-193203?auto=format%2Ccompress&q=75&sharp=10&s=7e15898f3fbee413d4f877f59f6b13ae",
"width": 992,
"height": 1218
},
"focal_point": {},
"image_id": "822591399",
"crop_mask": {},
"aspect_ratio": "0.8144499178981937602627257800",
"id": "822591399"
}
},
"semantic_purpose": "",
"timed_display": null,
"display_restrictions": []
}
],
"widgets": [],
"pagination": {
"object_count": 100,
"page_number": 1,
"page_size": 100,
"page_count": 1
}
}