title: How to convert Postman Authorization OAuth2 request to code PHP or compresible process
body: <p>I'm working with new SAGE API v3.1.</p>
  
  <p>For first steps, I'm testing with Postman <a href="https://developer.sage.com/api/accounting/quick_start_guide/create-your-first-request/" rel="nofollow noreferrer">according manual</a> for get authorization.</p>
  
  <p>Any problem, with test. When make a call for get New Access Token, postman send request, and SAGE open a modal window for ask my credentials for connect my request to one account.</p>
  
  <p>Well. I try several options with Laravel 5.7, include modifications on Laravel Socialite, but not work. On all tries, get a Internal Server Error and I assume it's because I'm sending the request wrong.</p>
  
  <p>On SAGE manual, I don't see more that Postman example for get access token. Not example for php, curl, ...</p>
  
  <p>For others request I don't problem using Guzzle, but I need get tokern y refreesh token, with Postman. Horrible.</p>
  
  <p><a href="https://i.stack.imgur.com/RNal5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RNal5.png" alt="enter image description here"></a></p>
  
  <p>Image show real information for Test account.</p>
  
  <p>On postman console, get some infor, but I lost with this and Internal Server error</p>
  
  <pre><code>Request Headers:
     content-type:"application/x-www-form-urlencoded"
     user-agent:"PostmanRuntime/7.3.0"
     accept:"*/*"
     host:"oauth.accounting.sage.com"
     accept-encoding:"gzip, deflate"
     content-length:274
  Request Body:
     grant_type:"authorization_code"
     code:"ES/e1fd0bc2-1d06-41b6-902a-beb584f24ccf"      
     redirect_uri:"https://localhost/login/sage/callback"
     client_id:"c420127c-76f3-48e5-9c11-77fcba90402d/2c09ea61-249c-4958-96f0-89209f1939e8"
     client_secret:"?]@4iVWBhx/)gN;bA2M%"
  </code></pre>
  
  <p>NOTE: All data es valid for testing.
   NOTE2: this is a piece that i don't understand <code>code:"ES/e1fd0bc2-1d06-41b6-902a-beb584f24ccf"</code> What is it? How to generate?</p>
  
  <p>With this data, I try to put link <a href="https://www.sageone.com/oauth2/auth/central?grant_type%3Aauthorization_code%26code%3DES%2F37048339-8db2-4168-bfb0-760ef6709b93%26redirect_uri%3Dhttps%3A%2F%2Flocalhost%2Flogin%2Fsage%2Fcallback%26client_id%3Dc420127c-76f3-48e5-9c11-77fcba90402d%2F2c09ea61-249c-4958-96f0-89209f1939e8%26client_secret%3D%3F%5D%404iVWBhx%2F)gN%3BbA2M%25%0A" rel="nofollow noreferrer">https://www.sageone.com/oauth2/auth/central?grant_type%3Aauthorization_code%26code%3DES%2F37048339-8db2-4168-bfb0-760ef6709b93%26redirect_uri%3Dhttps%3A%2F%2Flocalhost%2Flogin%2Fsage%2Fcallback%26client_id%3Dc420127c-76f3-48e5-9c11-77fcba90402d%2F2c09ea61-249c-4958-96f0-89209f1939e8%26client_secret%3D%3F%5D%404iVWBhx%2F)gN%3BbA2M%25%0A</a>) imitate Postman, but after put my credentials, not return to callback. It instead got to SAGE Account.</p>