Answer the question
In order to leave comments, you need to log in
How to make the simplest request in qiwi api?
Good day, I started to study qiwi api and stalled at the first moment.
I wrote a code to get account information.
$json = '
Authorization: Bearer *******
';
$url = 'https://edge.qiwi.com/person-profile/v1/profile/current?authInfoEnabled=false';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{"serviceName":"qw-person-profile","errorCode":"http.method.not.supported","description":"Method is not supported","userMessage":"Method is not supported"," dateTime":"2019-09-17T10:10:11.806+03:00","traceId":"45c51ecd6d41eb60"}
Answer the question
In order to leave comments, you need to log in
Use Guzzle for requests , it's much easier than cURL.
And you somehow strangely carry out authorization. Authorization: Bearer *******
- it should be the request headers, not the body.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question