I'm trying to make a correct request to Telegram API.
Code:
api.call('upload.getFile', {
flags: 0,
precise: false,
cdn_supported:true,
location: {
_: 'inputPeerPhotoFileLocation',
flags: 0,
big: true,
peer:{
_: 'inputPeerChannel',
channel_id: 'xxxxxx',
access_hash: "xxxxxxxx"
},
local_id: xxxxx,
volume_id: "xxxxxx",
},
offset: 0,
limit: 1024 * 1024,
}).then(response =>
console.log(response))
}
It gives me an error:
Uncaught (in promise) {_: "rpc_error", error_code: 400,
error_message: "FILE_ID_INVALID"} error_code: 400 error_message:
"FILE_ID_INVALID"
_: "rpc_error"
But I get all data for this request as answer on api.call('channels.getAdminedPublicChannels')
.
What am I doing wrong?