Package com.twilio.sdk

Examples of com.twilio.sdk.TwilioRestResponse


        p.kick();
      }
    }

    // Make a raw request to the api... note, this is deprecated style
    TwilioRestResponse resp = client.request("/2010-04-01/Accounts", "GET",
        (Map) null);
    if (!resp.isError()) {
      System.out.println(resp.getResponseText());
    }

  }
View Full Code Here


   * @param params the params
   * @throws TwilioRestException the twilio rest exception
   */
  protected void load(Map<String, String> params) throws TwilioRestException {
    String path = this.getResourceLocation();
    TwilioRestResponse response = this.getClient().safeRequest(path, "GET",
        params);

    this.parseResponse(response);
    this.loaded = true;
  }
View Full Code Here

   *
   * @throws TwilioRestException the twilio rest exception
   */
  protected void fetchNextPage() throws TwilioRestException {
    // Fetch the next page and reset accounts
    TwilioRestResponse response = this.getClient().get(nextUri);
    this.parseResponse(response);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.twilio.sdk.resource.factory.SmsFactory#create(java.util.Map)
   */
  public Sms create(Map<String, String> params) throws TwilioRestException {
    TwilioRestResponse response = this.getClient().safeRequest(
        this.getResourceLocation(), "POST", params);
    return makeNew(this.getClient(), response.toMap());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.twilio.sdk.resource.factory.SmsFactory#create(java.util.List)
   */
  public Sms create(List<NameValuePair> params) throws TwilioRestException {
    TwilioRestResponse response = this.getClient().safeRequest(
        this.getResourceLocation(), "POST", params);
    return makeNew(this.getClient(), response.toMap());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.twilio.sdk.resource.factory.IncomingPhoneNumberFactory#create(java.util.Map)
   */
  public IncomingPhoneNumber create(Map<String, String> params) throws TwilioRestException {
    TwilioRestResponse response = this.getClient().safeRequest(
        this.getResourceLocation(), "POST", params);
    return makeNew(this.getClient(), response.toMap());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.twilio.sdk.resource.factory.IncomingPhoneNumberFactory#create(java.util.List)
   */
  public IncomingPhoneNumber create(List<NameValuePair> params) throws TwilioRestException {
    TwilioRestResponse response = this.getClient().safeRequest(
        this.getResourceLocation(), "POST", params);
    return makeNew(this.getClient(), response.toMap());
  }
View Full Code Here

   * @throws TwilioRestException if there is an error in the request
   */
  public boolean close() throws TwilioRestException {
    Map<String, String> vars = new HashMap<String, String>();
    vars.put("Status", "closed");
    TwilioRestResponse response = this.getClient().safeRequest(this.getResourceLocation(), "POST", vars);

    return !response.isError();
  }
View Full Code Here

   * @param filters the filters
   * @return the call feedback summary
   * @throws TwilioRestException the twilio rest exception
   */
  public FeedbackSummary createFeedbackSummary(final Map<String, String> filters) throws TwilioRestException {
    TwilioRestResponse response = getClient()
        .safeRequest(getResourceLocation("") + "/Calls/FeedbackSummary.json", "POST", filters);
    return new FeedbackSummary(getClient(), response.toMap());
  }
View Full Code Here

   * @param sid the summary sid
   * @return the call feedback summary
   * @throws TwilioRestException the twilio rest exception
   */
  public FeedbackSummary getFeedbackSummary(final String sid) throws TwilioRestException {
    TwilioRestResponse response = getClient()
        .safeRequest(getResourceLocation("") + "/Calls/FeedbackSummary/" + sid + ".json", "GET", (Map) null);
    return new FeedbackSummary(getClient(), response.toMap());
  }
View Full Code Here

TOP

Related Classes of com.twilio.sdk.TwilioRestResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.