Accessing the Syrinscape API with javascript

I totally caved and got cors-anywhere working… #SorryNotSorry

2 Likes

I’m trying to get this to work as well, I was able to comment most of the macro the OP posted and it does work…

If I make a Macro in Foundry VTT to play on casting the Bless spell for instance
fetch('https://www.syrinscape.com/online/frontend-api/elements/415635/play/?auth_token=SecretToken', { mode: 'no-cors'})

It plays, but at max volume. Is there a way through the link to specify to play at like 50%? I have the One Shot volume at 100% due to needing the voices to be heard, but if we cast a spell it is very loud.

Thanks

Hi,

My control panel has been working for weeks - until tonight’s game.

I’m now getting 401 responses from syrinscape via the cors-anywhere proxy. Is there an updated way of accessing the URIs?

@yamahito I just tested your control panel, and it seems to be working for me. We have not changed anything that should be impacting your ability to make the same API requests. Is it still not working for you? If so, could you provide any further detail on specific requests that are failing and the body of the 401 response?

Thanks for that; it turns out by the time you would have checked, I was over halfway through fixing.

Turns out the problem was with those API links where I wasn’t processing a response; they were originally made using a GET form, although it was on my list of things to do to change them into XHRs. So that’s what I did, and it’s now working much better than it ever was.

I also had to add timestamps to the state requests, since the browser seemed to be caching those - but that’s by the by.

Odd, though, that the form submits were working for so long and then stopped between last week and this.

It is unclear to me if this is a going concern, but I would like to say that we have added cross origin CORS support to our API, so the proxy should no longer be required, and hopefully this makes it less troublesome to create and maintain these cool projects!

2 Likes

I’m still using the tool, not had much time recently to update it, so it’s still using the old CORS workaround, but no great shakes.

2 Likes