You need to sign in to do that
Don't have an account?
Status=Bad Request, StatusCode=400
Hi all ,
i want to integrate salesforce with constantcontact using oauth authentication. for this i wrote aclass like this.
public class Constantcontactoauth{public void invokeExternalWs(){Http h = new Http(); HttpRequest req = new HttpRequest(); final string username = 'Apikey%username%Consumer Secret'; Blob headerValue = Blob.valueOf(username); String authorizationHeader = 'oauth' +EncodingUtil.base64Encode(headerValue); req.setHeader('Authorization',authorizationHeader); req.setHeader('Host','https://oauth.constantcontact.com/ws/oauth/request_token'); req.setHeader('Connection','keep-alive'); req.setHeader('Content-Type', 'application/atom+xml'); req.setMethod('POST'); req.setbody('https://oauth.constantcontact.com/ws/oauth/request_token'); req.setEndpoint('https://oauth.constantcontact.com/ws/oauth/confirm_access'); HttpResponse res = h.send(req); system.debug(res.getbody());
}}
All credentials are valid. But i got an response like Status=Bad Request, StatusCode=400.whats wrong in my code.Please can any one help me.
Thanks in advance.
anu
can you please attach the code using the attach code button. So that it will be readable enough
Even i am facing same problem
I am actually doing sharepoint integration
please let me know ,if any solution's
Thanks..