Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Unable to perform "write" calls (only read) through REST

Hi,

For some reason, we are unable to perform "write" calls through the REST api for CS 8.4 (R07).

According to the logs, the authentication is OK (basic auth with a SO system user), but the call is then rejected with an "403: Forbidden" error:

{
"Error": true,
"ErrorType": "WebException",
"Message": "The remote server returned an error: (500) Internal Server Error.",
"ErrorSource": "System"
}

This goes for all "write" calls we have tried including POST, PUT and DELETE.

GET on the other hand works wonders.

 

We also have a test-environment with the same version of CS and here everything works perfectly.

I have gone through the IIS and web.config for both environments, but I cannot find an obvious difference.

 

The only difference I can think of is that the test-environment has everything running on the same server. (CS, SQL and API)

For production, we have split the API out to a separate server as well as the SQL.

The API in test also uses http. Prod API uses https.

 

It is worth mentioning that this might have been an issue from the beginning when we first started using the API in prod.

I cannot remember it ever working.

 

We are still troubleshooting the issue, but any help is greatly appreciated as this is a rather critical function for us.

Thanks!

RE: Unable to perform "write" calls (only read) through REST

Well, the error seems to be coming from inside Netserver, so it doesn't look like an IIS config issue.

 

Enable log-to-file, turn on LogInformation and LogErrors and Warnings in the web.config, and try to make some API calls, and look at the resulting logs to see what is going on inside NetServer.

Send logs and other details to sdk@superoffice.com to open an issue.

Av: Christian Mogensen 17. jun 2019

RE: Unable to perform "write" calls (only read) through REST

Thanks for the info, Christian.

I have sent an e-mail to sdk@ now with the logfiles from my API calls.

Av: Markus Moripen 18. jun 2019

RE: Unable to perform "write" calls (only read) through REST

We got it working!

It was a rather simple solution, which we of course forgot to take into account in our scenario:

Since we split the API out to a separate server and ran the "Web" installation on that server, the SymmetricKey and Secret generated by the config differed from the ones the NetServer used.

I updated the web.config for the API with the same values the NetServer uses and voilà!

A silly oversight on my part, but thank you for the assistance nevertheless!

Av: Markus Moripen 18. jun 2019