Hi Team,
Hope you are doing well.
I am facing an issue while calling Create Training API, below is the response received from server at application level:
java.io.IOException: Server returned HTTP response code: 500 for URL: https://api.getgo.com/G2T/rest/organizers/123221312/trainings
Here are the details:
Product: GoToTraining
Problem Description:
When creating a meeting getting error code as "Server returned HTTP response code: 500".
API Method: Create Training
Request URL: https://api.getgo.com/G2T/rest/organizers/123221312/trainings
Authorization : 56789
organizerKey : 123221312
Create GoToTraining Java REST API Code:
JSONObject object=new JSONObject();
JSONArray array=new JSONArray();
JSONObject trainobject=new JSONObject();
object.put("name","Test LMS");
object.put("description","test");
object.put("timeZone","America/Los_Angeles");
trainobject.put("startDate", "2018-11-29T03:28:40Z");
trainobject.put("endDate", "2018-11-29T04:28:40Z");
array.add(trainobject);
object.put("times",trainobject);
trainobject=new JSONObject();
trainobject.put("disableConfirmationEmail", true);
trainobject.put("disableWebRegistration", true);
array=new JSONArray();
array.add(trainobject);
object.put("registrationSettings",trainobject);
array=new JSONArray();
array.add(Long.parseLong("123221312"));
object.put("organizers",array);
url = new URL("https://api.getgo.com/G2T/rest/organizers/123221312/trainings");
urlConnection = url.openConnection();
((HttpsURLConnection)urlConnection).setRequestMethod("POST");
((HttpsURLConnection) urlConnection).setSSLSocketFactory(createSslSocketFactory());
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);
urlConnection.setUseCaches(false);
urlConnection.setAllowUserInteraction(true);
urlConnection.setRequestProperty("Content-Type", "application/json");
urlConnection.setRequestProperty("Accept", "application/json");
urlConnection.setRequestProperty("Authorization", "56789");
urlConnection.getOutputStream().write(object.toString().getBytes());
urlConnection.connect();
inStream = new DataInputStream(urlConnection.getInputStream());
--------------------------------------------------------------------
@sud The GoTo API Support template and followup instructions can be found here: https://goto-developer.logmeininc.com/api-support-request-template (supported via email)