We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Attention Online Developers

SuperOffice Online has published a tenant status URL that all applications are should ([must]) leverage to ensure stable reliable applications and integrations. 

Please read more about it here: Online Status.

RE: Attention Online Developers

Hi Tony, 

This is cool, and could be very useful.

I'd like to call it from a frontend GUI where I can see the status of all my customers. However, I'm running into CORS issues with the API call. 

Here is a simple code-example of what I'm trying to do.

//This works fine
fetch('https://jsonplaceholder.typicode.com/todos/1')
  .then(response => response.json())
  .then(json => console.log(json))

//This gives CORS error
fetch('https://sod.superoffice.com/api/state/Cust11737')
  .then(response => response.json())
  .then(json => console.log(json))

The last one fails with the message:

Access to fetch at 'https://sod.superoffice.com/api/state/Cust11737' from origin 'https://frode.geaslabs.no' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Would it be possible for you to add the 'Access-Control-Allow-Header' CORS headers to that endpoint?

Av: Frode Lillerud 13. sep 2019

RE: Attention Online Developers

Thank-you for pointing out the CORS issue when called from a browser. A CORS policy will be added to address this issue. It might take a day or so. Sorry for the inconvenience. 

Av: Tony Yates 13. sep 2019

RE: Attention Online Developers

Great, thank you!

Av: Frode Lillerud 13. sep 2019

RE: Attention Online Developers

OK, it only tooks a couple hours...could say minutes! ;- ) Seems to be good to go now! 

Best regards!

Av: Tony Yates 13. sep 2019

RE: Attention Online Developers

Hi Tony

Just a short question. If this state service is down or for some reason do not respond, I assume we can continue to use the latest received Endpoint value - even if the valid until time is passed - and do not switch back to the "original" Endpoint (sod/qaonline/online)? 

Av: Arild Eik 16. sep 2019

RE: Attention Online Developers

Hi Arild,

if the state URL is down or does not respond then the tenant would (most likely) not answer either.

But, if for any reason the state shows the login page then we have a bug and you should send us an email.

If all the services behind are down then it will return "Unknown".

Av: Margrethe Romnes 16. sep 2019

RE: Attention Online Developers

This seems very useful to improve on incident handling and retry policy!

As we have a lot of separeted cloud processes I'm looking into putting this into a memory cache for each process, so I wonder how strict the validUntil property is? Can we expect the endpoint not to change until this time?

Av: Carlo Pompen 16. sep 2019

RE: Attention Online Developers

That is our ambition, yes :)

Av: Margrethe Romnes 18. sep 2019