Authorisation problem with REST Sensor

Hi everyone!

I’m trying to create a RESTful sensor with the following code in sensor.yaml


- platform: rest
  name: Current Sales 1
  resource: https://statistics-api.wildberries.ru/api/v1/supplier/orders
  params:
    dateFrom: "2023-10-23T14:45:00"
    flag: 0
  headers:
    Authorization: !secret current_s
    accept: application/json
  value_template: " {{ value_json.message }} "
  timeout: 5
  scan_interval: 1800

Instead of getting the info from the API I’m getting the following message, indicating the problem with authorisation error Code 401:

07e4668e-a53a3d31f8b0-UK:dHP4D4TKTpg unauthorized, rejected; 84bd353bf-75 token problem; token is malformed: could not base64 decode signature: illegal base64 data at input byte 43

At the same time, when I issue the following command, the info is fetched without a problem:

curl -X ‘GET’
https://statistics-api.wildberries.ru/api/v1/supplier/orders?dateFrom=2023-10-23T10%3A45%3A00&flag=0
-H ‘accept: application/json’
-H 'Authorization: The token goes here

Can someone tell me what am I doing wrong?