Answer the question
In order to leave comments, you need to log in
How to generate a token on login?
There is an Intersect Engine, it has an API, but the documentation for this API is not yet complete. There is a section with an input
But how to create a token, I did not understand. I leafed through the documentation on this issue on the php site and still did not catch up ... I would be grateful for the help
Answer the question
In order to leave comments, you need to log in
Judging by the documentation from the screenshot
1. the request must be POST
2. the request data must be a json string in post-data
$data = array(
"grant_type" => "password",
"username" => "......",
"password" => "......",
);
$data_string = json_encode($data);
$ch = curl_init('http://domain.tld/api/oauth/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
var_dump($result);
welcome to the world of river engineering) open the code and read..
So there is all the necessary information. You just need to send a Post request to the given url with login, hashed password and type. You will receive an authorization token in response.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question