The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

400 Bad Request: Response realm name {0} does not match system realm name of {1}

Highlighted
Occasional Visitor

400 Bad Request: Response realm name {0} does not match system realm name of {1}

Currently trying to connect via OAuth.  When I request a token I get:

 

"The request sent by the client was syntactically incorrect (Response realm name {0} does not match system realm name of {1})."

 

I am using python and I tried supplying a realm name in the headers.  I am currently developing on my local machine localhost:8000 using Django.

 

This is how I am connecting:

 

consumer = oauth.OAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET)

sha1 = oauth.OAuthSignatureMethod_HMAC_SHA1()

connection = httplib.HTTPSConnection('oauth.constantcontact.com')

 

oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer, callback='https://localhost:8000/social/ctct/auth/', http_url='https://oauth.constantcontact.com/ws/oauth/request_token', http_method='POST')

oauth_request.sign_request(sha1, consumer, None)

connection.request('POST', 'https://oauth.constantcontact.com/ws/oauth/request_token', headers=oauth_request.to_header())

 

params are as follows:

{'oauth_nonce': '95246787', 'oauth_timestamp': 1312309636, 'oauth_consumer_key': 'XXX', 'oauth_signature_method': 'HMAC-SHA1', 'oauth_version': '1.0', 'oauth_signature': 'SIG', 'oauth_callback': u'https://localhost:8000/social/ctct/auth/'}

 

 

 

2 REPLIES 2
Highlighted
Employee

Re: 400 Bad Request: Response realm name {0} does not match system realm name of {1}

Hey Wendy,

 

I will look into this for you but it may take me some time to get my resources together.

 

Thanks,

Ryan Davis
Quality Engineer
Highlighted
Occasional Visitor

Re: 400 Bad Request: Response realm name {0} does not match system realm name of {1}

I have found the issue.  I'll post a snippet of connecting using python when I complete my integration.  Myabe others will find it useful.  Thanks for the response though.

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured