Hello,
When trying to write a logic function that uses the list devices core API I get the following error:
Error: Particle API user not configured
at job (particle-internal:user-code:5:12)
at particle-internal:main:20:7
Here is the source code for the function, with our product ID abstracted:
import Particle from 'particle:core';
export default function job({ functionInfo, trigger, scheduled }) {
Particle.listDevices('<PRODUCT_ID>')
.then((devices) => {
console.log('Got Devices');
})
.catch((error) => {
console.log(`Failed: ${error}`)
})
;
}
I've tried a few of the other API calls and they all seem to fail the same.
How can I configure this function to be authenticated with an API user?