1

Please help how to call flowgear workflow using JAVA POST API. My flowgear end point is 6.somesubdomain.mydomain(This end point is valid?).I used this code to call flowgear workflow but it is not work my end point is not call(please check my end point is valid).

URL myURL = new URL("https://6.somesubdomain.mydomain.flowgear.io/test/");
HttpURLConnection con = (HttpURLConnection)myURL.openConnection();
String userCredentials = "email:password";
String basicAuth = "Basic " + new String(new Base64().encode(userCredentials.getBytes()));
con.setRequestProperty ("Authorization", basicAuth);
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestMethod("POST");
con.connect();

OutputStream os = httpCon.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");

osw.write(somejsondata.toString());
osw.flush();
osw.close();

Please give me response. Thanks.

sanjay
  • 437
  • 3
  • 17
  • What HTTP response do you get back when you try to invoke this endpoint? – Daniel Feb 08 '16 at 07:20
  • {"statusCode":"1","message":"success","Response code ":404,"Post request URL ":"https://6.somesubdomain.mydomain.flowgear.io/test/"} – sanjay Feb 08 '16 at 07:22
  • This call is definitely hitting Flowgear - the JSON response is being constructed from within your workflow - doesn't look like there's a problem there – Daniel Feb 08 '16 at 07:28
  • I get success with endpoint: "https://6.somesubdomain.flowgear.io/test/", but still getting error 404 with "https://6.somesubdomain.mydomain.flowgear.io/test/". so i guess it was the issue of domain name. – sanjay Feb 08 '16 at 07:30
  • You can only have one vanity domain for a Flowgear site - not per workflow. If you change the vanity domain, the domain for all workflows you previously created will be changed too. Also, using sub-domains within the vanity domain is not actually supported. – Daniel Feb 08 '16 at 07:32

0 Answers0