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.

Authorization code is malformed.

SOLVED
Go to solution
Highlighted
Occasional Contributor

Authorization code is malformed.

So I have a API Key and Secret with I ran in the terminal 

 

echo -n APPIKEY:ssecret | base64....I then put that into the Authorization header to the endpoint 


https://idfed.constantcontact.com/as/token.oauth2?code=code&redirect_uri=https://localhost&grant_typ...

 

in postman I set up a post to the above address with the base64 encoded API Key and secret to get the authorization key......what I get back in postman is


{"error_description":"Authorization code is malformed.","error":"invalid_grant"}
 
Unsure why....
 
Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: Authorization code is malformed.

Ok For anyone new to this using Python or another backend scripting language or (POSTMAN).......

  1. Make a v3 application in your account.
  2. Get the client_id(API key) and secret from this app. 
  3. Find a way to base 64 the client_id:secret <<in this format together.  You'll need it.. 
  4. Paste 
    https://api.cc.email/v3/idfed?client_id={{APIKEY}}&redirect_uri=https://localhost&response_type=code... 
    Into a brroowser and allow the application the {{APIKEY}} is your client_id....
    you will get a url like 
    https://localhost/?code=kasdlfakjsdlakjdfaljf09sdf0asdfu0adsfj
    You will need the above code....
  5. In postman set up a call to 
    https://idfed.constantcontact.com/as/token.oauth2?code={{CODE}}t&redirect_uri=https://localhost&gran...
    Wherre the {{CODE}} is your code from step 4
    In this call you need to setup an Authorization header with the BASE64 encoded stuff from step 3.
  6. Get a JSON block back with auth and refresh key and use in your backend app....

 

View solution in original post

Tags (3)
2 REPLIES 2
Highlighted
Occasional Contributor

Re: Authorization code is malformed.

ok at the point where I have an auth key however now getting message about invalid scopes.

Highlighted
Occasional Contributor

Re: Authorization code is malformed.

Ok For anyone new to this using Python or another backend scripting language or (POSTMAN).......

  1. Make a v3 application in your account.
  2. Get the client_id(API key) and secret from this app. 
  3. Find a way to base 64 the client_id:secret <<in this format together.  You'll need it.. 
  4. Paste 
    https://api.cc.email/v3/idfed?client_id={{APIKEY}}&redirect_uri=https://localhost&response_type=code... 
    Into a brroowser and allow the application the {{APIKEY}} is your client_id....
    you will get a url like 
    https://localhost/?code=kasdlfakjsdlakjdfaljf09sdf0asdfu0adsfj
    You will need the above code....
  5. In postman set up a call to 
    https://idfed.constantcontact.com/as/token.oauth2?code={{CODE}}t&redirect_uri=https://localhost&gran...
    Wherre the {{CODE}} is your code from step 4
    In this call you need to setup an Authorization header with the BASE64 encoded stuff from step 3.
  6. Get a JSON block back with auth and refresh key and use in your backend app....

 

View solution in original post

Tags (3)
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