You need to sign in to do that
Don't have an account?

integration help salesforce & aweber
HI,
I want to integrate salesforce & Aweber. I have sample Aweber account. I am getting bad error, 400 in my system log
passing url's, you can find here.
https://labs.aweber.com/docs/authentication
Please give me suggestions regarding connection between both accounts
public class Aweberoauth
{
public void invokeExternalWs()
{
Http h = new Http();
HttpRequest req = new HttpRequest();
final string username = 'aweber provided some keys as consumer';
Blob headerValue = Blob.valueOf(username);
String authorizationHeader = 'oauth' +EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization',authorizationHeader);
req.setHeader('Host','https://auth.aweber.com/1.0/oauth/request_token');
req.setHeader('Connection','keep-alive');
req.setHeader('Content-Type', 'application/atom+xml');
req.setMethod('POST');
req.setbody('https://auth.aweber.com/1.0/oauth/access_token');
req.setEndpoint('https://auth.aweber.com/1.0/oauth/authorize');
HttpResponse res = h.send(req);
system.debug(res.getbody());
}
}