Hello
I am working with Laravel, and I am using PHP API SDK - https://github.com/constantcontact/php-sdk.
And also I see this - http://developer.constantcontact.com/docs/authentication/oauth-2.0-server-flow.html.
Now I am trying to get access_token.
I saw this - https://github.com/constantcontact/php-sdk/blob/master/examples/getAccessToken.php, I am working based on this.
From $oauth->getAuthorizationUrl(); , it is successfully redirected to redirect_uri page.
And also i see code in url parameters there.
But when it called getAccessToken(), it is failed with exception 'Unauthorized'
This is my code.
Solved! Go to Solution.
I found the reason myself.
It is from redirect uri paramter.
I used correct redirect uri, but with some parameter.
In this time, it was not working.
I fixed it by removing parameter.
Thanks
Nobody can help?
I get this code.
iuhYBa9Uv7oXt30WkEShBsl1OGZ
But I can't get access_token from it.
Maybe this code is invalid?
Hello @lara4,
Thank you for reaching out to Constant Contact's API Support.
If you are receiving an unauthorized error then either your API Key is not correct, or the username/password you are logging in with are not authorized to do what you are requesting. Since you are just trying to get an Access Token I would first try to use our API Tester page and see if you can get an Access Token with the same credentials there. https://constantcontact.mashery.com/io-docs
If you are still having problems I would suggest you email us at webservices@constantcontact.com so we can troubleshoot further as we may need some information that is best to not post here.
@Jimmy_D, Thanks for your response.
I think it is related with redirect_uri.
I will see that.
Regards
I found the reason myself.
It is from redirect uri paramter.
I used correct redirect uri, but with some parameter.
In this time, it was not working.
I fixed it by removing parameter.
Thanks
Hi @lara4,
Glad to hear that you got that figured out. For anyone else who may come across this post just keep in mind that the redirect URI must match exactly. That includes parameters as well.
Hi, @Jimmy_D
Thanks!
Regard
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article