Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. $ch = curl_init();
  2. curl_setopt($ch, CURLOPT_URL, 'https://test.salesforce.com/services/oauth2/token');
  3. curl_setopt($ch, CURLOPT_POST, 1);
  4. curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
  5.  
  6. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  10. curl_setopt($ch, CURLOPT_TIMEOUT, 300);
  11.  
  12. $result = curl_exec($ch);
  13.  
  14. curl_close($ch);
  15.  
  16. "{"error":"unknown_error","error_description":"retry your request"}"
  17.  
  18. params = array(
  19. 'grant_type' => 'password',
  20. 'client_id' => $clientId,
  21. 'client_secret' => $clientSecret,
  22. 'username' => $username,
  23. 'password' => $password . $securityToken,
  24. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement