code: public static Endpoint create(final BandwidthClient client, final String domainId, final Map<String, Object>params) throws AppPlatformException, ParseException, Exception {
          assert (client!= null && params != null);
          final String endpointsUri = String.format(client.getUserResourceUri(BandwidthConstants.ENDPOINTS_URI_PATH), domainId);
          final RestResponse response = client.post(endpointsUri, params);
          final JSONObject callObj = toJSONObject(client.get(response.getLocation(), null));
          return new Endpoint(client, callObj);
      }
docs: Convenience factory method to create a Endpoint object from a map of parameters
  @param client the bandwidth client configuration.
  @param domainId the domain id.
  @param params the request parameters.
  @return the created endpoint.
  @throws AppPlatformException API Exception
  @throws ParseException Error parsing data
  @throws Exception error