• vaibhav dhawale
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi All,

    i wrote this class for integration of Mailchimp with salesforce using apis

 

public class MailchimpOauth{public void invokeExternalWs(){Http h = new Http();   HttpRequest req = new HttpRequest();               //req.setHeader('Host','https://oauth.constantcontact.com/ws/oauth/request_token');      req.setBody('https://login.mailchimp.com/oauth2/authorize');   req.setBody('https://login.mailchimp.com/oauth2/token');   req.setBody('https://login.mailchimp.com/oauth2/');   req.setBody('https://login.mailchimp.com/oauth2/metadata');
    req.setHeader('Connection','keep-alive');    req.setHeader('Content-Type', 'application/atom+xml');    req.setMethod('POST');    req.setEndpoint('https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=957533735502&redirect_uri=http://localhost/oauth/complete.php');

     HttpResponse res = h.send(req);      system.debug(res.getbody());
}}

 

But i got a response like  Status=Bad Request, StatusCode=400 &&&&&error=invalid_client_id&error_description=client%20identifier%20invalid.How to fix this.

any one can u please rectify this.can u give me the solution for fixing that.calient id given in that one is valid.But i dont know how the response coming like this.

 

Thanks in advance.

anu

 

  • September 27, 2011
  • Like
  • 0