I'm using Scribe
to authenticate with API
of Google Calendar
.
Authentication with Google is done successfully returning accessToken
with no problems.
When I try to add a CalendarList
, through the following code:
OAuthRequest request = new OAuthRequest(Verb.POST, "https://www.googleapis.com/calendar/v3/users/me/calendarList");
JSONObject message = new JSONObject();
message.put("id", "Teste 1");
request.addPayload(message.toJSONString());
service.signRequest(accessToken, request);
Response response = request.send();
Google returns the following error this api does not support parsing form-encoded input
How should I build the request in JSON so that it has a response from Google?