Package com.createsend.util

Examples of com.createsend.util.JerseyClientImpl


            + URLEncoder.encode(oauthDetails.getRefreshToken(),
                urlEncodingScheme);
      } catch (UnsupportedEncodingException e) {
        body = null;
      }
      JerseyClient oauthClient = new JerseyClientImpl(null);
     
        // TODO: Use a custom error deserialiser in the following post

      result = oauthClient.post(Configuration.Current.getOAuthBaseUri(),
          OAuthTokenDetails.class, body,
          MediaType.APPLICATION_FORM_URLENCODED_TYPE, "token");
      if (result != null && result.access_token != null
          && result.refresh_token != null) {
        AuthenticationDetails newAuthDetails = new OAuthAuthenticationDetails(
View Full Code Here


     * @param auth The authentication details to use when making API calls.
     * May be either an OAuthAuthenticationDetails or
     * ApiKeyAuthenticationDetails instance.
     */
  public Administrators(AuthenticationDetails auth) {
    this.jerseyClient = new JerseyClientImpl(auth);
  }
View Full Code Here

     * @param auth The authentication details to use when making API calls.
     * May be either an OAuthAuthenticationDetails or
     * ApiKeyAuthenticationDetails instance.
     */
    public General(AuthenticationDetails auth) {
      this.jerseyClient = new JerseyClientImpl(auth);
    }
View Full Code Here

      int    clientID,
      String clientSecret,
      String redirectUri,
      String code) throws CreateSendException {

      JerseyClient oauthClient = new JerseyClientImpl(null);
      String body = "grant_type=authorization_code";
      try {
          body += "&client_id=" + String.valueOf(clientID);
          body += "&client_secret=" + URLEncoder.encode(clientSecret, urlEncodingScheme);
          body += "&redirect_uri=" + URLEncoder.encode(redirectUri, urlEncodingScheme);
          body += "&code=" + URLEncoder.encode(code, urlEncodingScheme);
    } catch (UnsupportedEncodingException e) {
      body = null;
    }
     
      // TODO: Use a custom error deserialiser in the following post

      OAuthTokenDetails result = oauthClient.post(
          Configuration.Current.getOAuthBaseUri(), OAuthTokenDetails.class, body,
          MediaType.APPLICATION_FORM_URLENCODED_TYPE, "token");
      return result;
    }
View Full Code Here

     * ApiKeyAuthenticationDetails instance.
     * @param campaignID The campaign ID to use when making API calls.
     */
    public Campaigns(AuthenticationDetails auth, String campaignID) {
      this.setCampaignID(campaignID);
        this.jerseyClient = new JerseyClientImpl(auth);
    }
View Full Code Here

     * ApiKeyAuthenticationDetails instance.
     * @param campaignID The campaign ID to use when making API calls.
     */
    public Campaigns(AuthenticationDetails auth, String campaignID) {
      this.setCampaignID(campaignID);
        this.jerseyClient = new JerseyClientImpl(auth);
    }
View Full Code Here

TOP

Related Classes of com.createsend.util.JerseyClientImpl

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.