error status 401
-
method: 'POST',
url: 'https://prebook.jsreportonline.net/api/report',
headers: {
'Content-Type': 'application/json',
'WWW-Authenticate': 'Basic dmFsdGVyOjYwdzFoYWhUYm0wM0RJ=='
},
body: {
template: {
shortid: 'B1t-hel6e'
},
data: {
aProperty: 'value'
}
}
}).send();
How to authenticate?
-
const result = await this.request({
method: 'POST',
url: 'https://prebook.jsreportonline.net/api/report',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==',
},
body: {
template: {
shortid: 'B1t-hel6e'
},
data: {
aProperty: 'value'
}
}
}).send();
-
Please better formulate your questions - How to authenticate? Is really not enough.
Are you able to login with this user and render the particular template in studio?
Is it admin user or a custom user created in studio?
If it is only problem of your client API call, can you try to userequest
package and post here full code?
Maybe you could also try to use markdown formatting to highlight code
https://help.github.com/articles/creating-and-highlighting-code-blocks/Thank you