logo

API Snippet

When you are pushing data from a different source to our API, you can use the following snippet to authenticate and send the data.

const axios = require('axios');

const {data} = await axios.post('https://api.solar-daytopper.com/device/login', {
  token: 'your-inverter-token'
});

await axios.post('https://api.solar-daytopper.com/solar', {
    total: 9000,
    current: 200,
  }, {
    headers: {
    Authorization: 'Bearer ' + data.token
  }
});