Authorization code is malformed.

SOLVED
Go to solution
JerryP488
Campaign Collaborator
0 Votes

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....
 
1 ACCEPTED SOLUTION
JerryP488
Campaign Collaborator
0 Votes

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

2 REPLIES 2
JerryP488
Campaign Collaborator
0 Votes

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

JerryP488
Campaign Collaborator
0 Votes

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....

 

Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up