I have a simple app that can successfully use the API with a JWT token. When I try to use nodejs fetch I have problems. I get a 403 error. The code is below. I must be setting up my headers incorrectly. The token value has been working, just not with fetch. I’m running on localhost:3000. The error returned in the catch is "TypeError: Failed to fetch {stack: ‘TypeError: Failed to fetch’, message: ‘Failed to fetch’}
"
async function meetingsGet(email, startDate, endDate) {
Just curious, have you tried removing the user-agent and content-type headers, since they are not required?
Other than that, I don’t see any reason as to why the code would not be working. Could you post an example of a completed request object? Have you tried this on a production server, rather than localhost?
accept:application/json
authorization: Bearer
content-type: application/json
Referer: http://localhost:3000/reports/gbezoomsummary
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
I need to create a production server yet. I’m hoping it’s possible to debug using localhost in some way.
Major brain fart. Since I had api calls working on a node server with a JWT I assumed I could do the same from within a React application. I need to look at the Web SDK. Too long out of the programming saddle!!