How do you update a calendar event's extended attributes in Velocity and/or REST API? It doesn't seem to be updating, and the documentation says it is read-only.
How do you update a calendar event's extended attributes in Velocity and/or REST API? It doesn't seem to be updating, and the documentation says it is read-only.
Where are you seeing it say read-only? The Event Update REST Endpoint shows ability to update Extended Attributes. There is also recently added guidance in he Developer Training area about Extended Attributes in REST.
It says Read, but no Write on this page https://community.telligent.com/community/11/w/api-documentation/66305/event-script-api-type
Isn't there a way to create the event with the ExtendedAttribute option, using the Script APIs? I'm having trouble getting the Id of the event after it has been created.
I think you're probably looking for the calendar_v1_events Script API, not the Event API Type which is what gets returned from those Script API calls. You should be able to assign your API call return value to a variable and find the assigned Id on that object.
The REST API is not updating the ExtendedAttributes. the following code updates the EventTitle and EventDescription, but not the ExtendedAttributes:
jQuery.telligent.evolution.put({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/calendars/events/{id}.json', data: { 'id': response.eventId, 'EventTitle': 'eventtitle', 'EventDescription': 'eventdescription', '_ExtendedAttributes_PostingEndDate': 'test' //$(context.inputs.postingEndDate).val(), }, success: function(response) { alert('success'+response); } });
I also came across a previous forum post by someone that had a similar problem.
As mentioned in the Extended Attributes in REST link I posted above, use two underscores at the beginning of the field name.
I tried this, and it still didn't work:
jQuery.telligent.evolution.put({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/calendars/events/{id}.json', data: { 'id': response.eventId, __ExtendedAttributes_PostingStatus: context.status, __ExtendedAttributes_PostingEndDate: "Test" //t$(context.inputs.postingEndDate).val() }, success: function(response) { alert('success'+response); } });
I tried this, and it still didn't work:
jQuery.telligent.evolution.put({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/calendars/events/{id}.json', data: { 'id': response.eventId, __ExtendedAttributes_PostingStatus: context.status, __ExtendedAttributes_PostingEndDate: "Test" //t$(context.inputs.postingEndDate).val() }, success: function(response) { alert('success'+response); } });
I believe you still need quotes around it to make properly formed JSON.
I've put quotes around it, and still no luck
jQuery.telligent.evolution.put({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/calendars/events/{id}.json', data: { 'id': response.eventId, '__ExtendedAttributes_PostingStatus': context.status, '__ExtendedAttributes_PostingEndDate': "Test" //t$(context.inputs.postingEndDate).val() }, success: function(response) { alert('success'+response); } });
I would inspect and share the raw HTTP request and response produced by this call to see what's being sent and received.
I would inspect and share the raw HTTP request and response produced by this call to see what's being sent and received.
How would I inspect the raw HTTP request and response?
You can see this in your browser's console. For example, if you're using Chrome: