Credentials generation

🚧

Important! Please ensure that you have the client_id and client_secret available.

To be able to use your Embed Panel, two steps will be necessary. Below is a basic structure that demonstrates implementation in Javascript and Laravel.

// RECOVERY COOKIES FROM AUTH TOKEN with Client Credentials
var myHeaders = new Headers();
myHeaders.append(
  "Content-Type",
  "application/x-www-form-urlencoded"
);
var requestOptions = {
  method: 'POST',
  headers: myHeaders,
};
fetch(
  "https://services.scaleup.com.br/authentication/v1/oauth/token
    ?grant_type=client_credentials
      &client_id=[CLIENT_ID]
      &client_secret=[CLIENT_SECRET]",
  requestOptions
)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
// RECOVERY COOKIES FROM AUTH TOKEN with Client Credentials
$client = new Client(['cookies' => true]);
$response = $client->request(
  'POST',
  'https://services.scaleup.com.br/authentication/v1/oauth/token
    ?grant_type=client_credentials
      &client_id=[CLIENT_ID]
      &client_secret=[CLIENT_SECRET]',
  [
    'headers' =>
      [
        'Content-Type' => 'application/x-www-form-urlencoded',
      ],
  ]
);
$cookieJar = $client->getConfig('cookies');
$cookieJar->toArray();
if ($response->getStatusCode() != 200) {
throw new \Exception('
  Error with status code: ' .
  $response->getStatusCode() .
  'and body: ' . $response->getBody()->getContents());
}
Language
Click Try It! to start a request and see the response here!