Answer the question
In order to leave comments, you need to log in
What is the correct way to use curl?
Hello guys. Faced such a question.
In general, I connect the API. I pass authorization through oauth2.
Stopped at the stage of obtaining a token. When I send a request with a code, it transfers to a page with the following code (as I understand it - json):
{
"access_token":"123c123dd94ccc1232303fb79f80a025390a50bdccaedca8d2349e9c65a2ce19",
"token_type":"bearer",
"expires_in":7200,
"refresh_token":"321c321dd94ccc3213213fb79f80a025390a50bdccaedca8d2349e9c65a2ce19",
"scope":"wallet:user:read wallet:accounts:read"
}
Answer the question
In order to leave comments, you need to log in
To begin with, write this curl'a response to a variable, for example $answer;
Then decode it from Json into an object (you can also into an array, about this is in the documentation)
And then you just refer to the access_token field of the newly created object$token = $object->access_token
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question