Error requesting access token API-REST

Good Afternoon, Requesting your support with the following topic:
We create an integration with SugaCRM through an API-REST.
The detail is that we are trying to obtain an authentication token from SugarCRM with the endpoint /rest/v11/oauth2/token using the authorization protocol: OAuth2

However we get the following response:
Error requesting access token
403 Forbidden
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>

We have proceeded with the following points
1. Token request from Postman which is correct.
2. Access credentials have been verified and are correct.
3. The connection user is “Active”.
Is there something we need to consider?
Thanks for your help.

Parents
  • I don't know if this helps but, I got this from someone on this group several years ago and I keep it on my web server to test custom API calls from PHP. I'm a lazy developer ;)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    //change to your environment
    $rest = "https://sugarcrm.devel.mydomain.com/sugarcrm/rest/v11";
    $user = "<the username here>"; // userid of the webservice user
    $pass = "<the password here>"; // and the password of user “user”
    //what you want to test:
    $parameters =
    array('email_addresses'=> array(
    'francesca.shiekh@mydomain.com',
    'francescas@mydomain.com'
    ));
    $api_to_test = '/doSomethingWithTheseEmails/';
    // get the token and execute
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Hope it helps you too!

Reply
  • I don't know if this helps but, I got this from someone on this group several years ago and I keep it on my web server to test custom API calls from PHP. I'm a lazy developer ;)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    //change to your environment
    $rest = "https://sugarcrm.devel.mydomain.com/sugarcrm/rest/v11";
    $user = "<the username here>"; // userid of the webservice user
    $pass = "<the password here>"; // and the password of user “user”
    //what you want to test:
    $parameters =
    array('email_addresses'=> array(
    'francesca.shiekh@mydomain.com',
    'francescas@mydomain.com'
    ));
    $api_to_test = '/doSomethingWithTheseEmails/';
    // get the token and execute
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Hope it helps you too!

Children
No Data