[ardoHTTP] How to add an object on the request body?

[ardoHTTP] How to add an object on the request body?

Forge Component
Published on 2015-06-04 by Ricardo Silva
15 votes
Published on 2015-06-04 by Ricardo Silva
Hi guys,

Congrats on the component. Very useful indeed.

I'm trying to call this service https://developers.google.com/google-apps/calendar/v3/reference/events/insert
but I'm not figuring out how to put the Event object on the request body. Any hint?

Hello Miguel,

For that api you should use the HTTPPost action and you enter the JSON of the event object (which you can create using ardoJSON ;) ) in the Data input parameter.

Best regards,
Ricardo Silva
Hi Ricardo,

Regarding the same request.

I've passed the following Event to the service:

"id" : "",
"status" : "confirmed",
"summary" : "Evento",
"description" : "",
"start" : {
"dateTime" : "2014-04-10T10:00:00.000-07:00"
"end" : {
"dateTime" : "2014-04-10T10:00:00.000-07:00"
"locked" : true

Using the google test feature, it goes smoothly and creates the event.

When I use HTTPPost, on Outsystems, returns me a BadRequest, due to a parse error (yes, the most specific message ever :D).

I'm using the HTTPPost on the following way:

URL - "https://www.googleapis.com/calendar/v3/calendars"
HTTPHeaders - Filled with the OAuth token (it's working because it doesn't give an unauthorized error)
Data - "calendarId=googleCalendarId&events?" + OutSystems2JSON.JSON
Content-type -

My main doubt is the Data as you told me. I've confirmed that the Outsystems2JSON.JSON is returning the very same structure I described before.

Can you help me?
Hi Carlos,

The Data attribute seems strange. shouldn't you have "events=" instead of "events?" ?
Not sure how this API works but since you're sending a JSON possibly you should have calendarId attribute in the URL and send the JSON only in the body....
You'll have to check Google Calendar's API.
Many thanks André and Ricardo. I'm already mastering Google API :D