Joe Lanza
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Downloads
Gallery
Posts posted by Joe Lanza
-
-
Hello,
Using Sage Cloud Accounting and a Sage Developers account. I was able to connect via postman no problem. However, in my application, I cannot convert my auth code into the auth token. I always get {"$severity":"error","$dataCode":"DataParsingError","$message":"The data you sent could not be processed.","$source":"Proxy"} as a response.
I have tried posting to
https://oauth.accounting.sage.com/token using every method imaginable (with the parameters as a string in the url, within the header, and within the body of the post request. Same response every time.
I am wondering if my initial auth code is incorrect. On return from the call back, I always get an auth code that looks something like this:
US/ccaf9694-ea52-49be-a334-eecfd2066cd5. However, the examples always show something with way less characters:12axxxxxxxxxxxxf7d.
Am I using the correct auth code? Any help would be amazing!
Thank you,
A simple programmer
Authentcation - convert auth code into auth token
in Support
Posted
Thank you for your reply.
Our application uses perl. I've tried this POST so many different ways now.
my $req = HTTP::Request->new(POST => https://oauth.accounting.sage.com/token);
$req->header('Content-type' => 'application/x-www-form-urlencoded');
$req->content(
[
client_id => $client_id,
client_secret => $client_secret,
grant_type => authorization_code,
code => $authcode,
redirect_uri => $redirect
]
);
the $req->content is the Body of the POST.
I've also tried putting these required values in the initial POST request: https://oauth.accounting.sage.com/token?client_id=$client_id&client_secret=$client_secret&code=$authcode&grant_type=authorization_code&redirect_uri=$redirect
I've also tried putting these required parameters in the header.
Can you provide a CURL example of this POST request and how the required parameters are supposed to be passed? The documentation is a little vague on this:
Required parameters
client_id
client_secret
code
grant_type
authorization_code
.redirect_uri
Thank you!