Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence API Endpoint for Calendar Entry

Matt Oberst October 7, 2020

I am trying to use the API to create a calendar entry with Postman.  I seem to be close receiving a 200 OK response, but still failing on a couple of things.

Here is some of the items...

Using JSON PUT request

http://confluence.(yourdomain).com/rest/calendar-services/1.0/calendar/events.json

Auth - Basic Auth - Use your user name and password

Header - Key: Content-Type Value: application/x-www-form-urlencoded

Body -

{    
"subCalendarId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",            "eventType":"Events",     
"what": "Test Meeting",     
"person": "(Your user ID)",    
"startDate": "Oct 11, 2020",    
"startTime": "10:00 AM",    
"endDate": "Oct 11, 2020",    
"endTime": "11:00 AM",    
"allDayEvent": "false",    
"where": "Test Room",}

 confluencepostman.png

It looks like it is going to the right URL, but my fields might be incorrect.  Anyone have any suggestions?  I have tried digging through the internet and some of the python suggestions didn't seem to work either.

1 answer

0 votes
Jia Xu February 22, 2022

Hi Matt


In case you or anyone else still need this. The Rest API only works on Get for me, I too couldn't get it to work with put.


While inspecting how this works on the interface I've noticed that the page actually send the body as encoded URL instead of a json. Hence got it to work by mimicing what the interface is doing instead.

In your header change the content type to below
request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";


The URL format is something like below substitute your data into it.

"?confirmRemoveInvalidUsers=false&childSubCalendarId=&customEventTypeId={youreventtypeID}&eventType=custom&isSingleJiraDate=false&originalSubCalendarId=&originalStartDate=&originalEventType=&originalCustomEventTypeId=&recurrenceId=&subCalendarId=" + caldendaID + "&uid=&what=" + HttpUtility.UrlEncode(title) + "&startDate=" + HttpUtility.UrlEncode(startDateString) + "&startTime=" + HttpUtility.UrlEncode(startTimeString) + "&endDate=" + HttpUtility.UrlEncode(endDateString) + "&endTime=" + HttpUtility.UrlEncode(endTimeString) + "&allDayEvent=false&rruleStr=&until=&editAllInRecurrenceSeries=true&where=" + HttpUtility.UrlEncode(where) + "&url=&description=" + HttpUtility.UrlEncode(body) + "&userTimeZoneId =Australia%2FPerth";

Hope this helps.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events