Answer the question
In order to leave comments, you need to log in
Odnoklassniki Bot api. How to upload and send a file to a user?
Good day. I'm trying to send a file to the user of the classmates chat bot. I read the documentation https://apiok.ru/dev/graph_api/methods/graph.user/... but at the second step I fall down.
Uploading a file to the server
You need to upload a file to the URL obtained in the previous step.
This is done through an HTTP POST request, in the body of the request it is necessary to transfer the file that you want to download.
$client->request( 'POST', $result->url, [
'http_errors' => false,
'headers' => [
'Content-Type'=> 'multipart/form-data'
],
'data' => "https://test.ru/Files/".basename($file->name),
] );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question