Template variables not updated when sending notification via Platform API

I have created a dashboard template (for my feed) with ‘name’ and ‘battery’ as variables. However, when using the code below from the server, the data I enter does not appear in my iOS app, only if I send the notification from the SendBird Dashboard. Instead of displaying the actual values, it just shows the placeholders {name} and {battery} like in the template:

[POST https://api-{application_id}.notifications.sendbird.com/v1/notifications]

const response = await axios.post(
  url,
  {
    template: {
      key: 'testing',
      variables: {
        userId: {
          'battery': battery,
          'name': name,
        },
      },
    },
    mode: 'realtime',
    targets: [userId],
  },
  {
    headers: {
      'Content-Type': 'application/json',
      'Api-Token': NOTIFICATIONS_TOKEN,
    },
  }
);

What could be the problem?

Hello @iulia-carl,

Welcome to the Sendbird Community.

Could you give me an exact sample payload where this didn’t work via the Platform API? You can DM me if you need.

Hello,

Thank you for your response. I wanted to clarify that the code snippet I shared earlier is exactly what I’m using on my Node.js server to send notifications. The code is part of a function that receives userId, battery, and name as parameters.

I use this function to send customized notifications to users, but, as I mentioned, the {name} and {battery} variables are not being replaced with their actual values in the iOS app, showing instead the placeholder text. This only happens when notifications are sent from the server, whereas if I use the SendBird Dashboard, everything works as expected.

Is there any additional configuration or a step that I might have missed in the process of integrating SendBird’s API with our Node.js server? Any suggestion or guidance would be greatly appreciated.

Thank you in advance for your help.