Ayarn Sawarn Posted April 11 Share Posted April 11 String uri = "https://myantMediaServer/LiveApp/rest/v2/broadcasts/conference-rooms/room1"; RestTemplate restTemplate = new RestTemplate(); Map<String, Object> body = new HashMap<>(); body.put("roomId", "room1"); body.put("startDate", 1649721600000L); body.put("endDate", 1649725200000L); body.put("roomStreamList", Arrays.asList("InomfbiuVGmWviqO", "zXAHbulMownySzss"));//here we passing the list of streamIds body.put("mode", "mcu"); body.put("originAdress" , "127.0.0.1"); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); headers.setContentType(MediaType.APPLICATION_JSON); headers.add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"); HttpEntity<Object> entity = new HttpEntity<>(headers); headers.add(StringConstants.COOKIE, myJessionSessionId); headers.setAccessControlAllowOrigin("*"); ResponseEntity<Map> response = restTemplate.exchange(uri, HttpMethod.POST , entity, Map.class); 403 Forbidden: [<!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} ... (654 bytes)] The get APIs of the conference room are working fine, but when we want to consume the post APIs or put APIs, it generates a forbidden error. Link to comment Share on other sites More sharing options...
Question
Ayarn Sawarn
String uri = "https://myantMediaServer/LiveApp/rest/v2/broadcasts/conference-rooms/room1";
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> body = new HashMap<>();
body.put("roomId", "room1");
body.put("startDate", 1649721600000L);
body.put("endDate", 1649725200000L);
body.put("roomStreamList", Arrays.asList("InomfbiuVGmWviqO", "zXAHbulMownySzss"));//here we passing the list of streamIds
body.put("mode", "mcu");
body.put("originAdress" , "127.0.0.1");
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("user-agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36");
HttpEntity<Object> entity = new HttpEntity<>(headers);
headers.add(StringConstants.COOKIE, myJessionSessionId);
headers.setAccessControlAllowOrigin("*");
ResponseEntity<Map> response = restTemplate.exchange(uri, HttpMethod.POST , entity, Map.class);
403 Forbidden: [<!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} ... (654 bytes)]
The get APIs of the conference room are working fine, but when we want to consume the post APIs or put APIs, it generates a forbidden error.
Link to comment
Share on other sites
Top Posters For This Question
1
Popular Days
Apr 11
1
Top Posters For This Question
Ayarn Sawarn 1 post
Popular Days
Apr 11 2023
1 post
0 answers to this question
Recommended Posts