While implementing SEGA's Noah Pass in our game, we found that GameSparks does not seem to currently have the ability to set the HTTP response code of a callback event.
This is necessary for the successful integration of SEGA's Noah Pass (and I am sure other services as well). The SEGA Noah Pass service requires us to respond with codes 403 and 225 under certain conditions.
Since this should be a relatively trivial enhancement to the callback system, I would like to request that it be added. I suggest the following notation:
Spark.setScriptData("HTTP_RESPONSE", "HTTP/1.0 403 Forbidden")
If this feature is already implemented and I missed it, please let me know, and also follow up with this other thread we found on the topic:
If you throw new Error("Somerror") inside an external callback script, the response body is empty and the status code is (200 OK).
It should return, 500 if we were to follow any standard behavior of restful api's.
"500 Internal Server Error "
"The server encountered an unexpected condition which prevented it from fulfilling the request."
I've added this as a feature request in our backlog. If there is any change to it's status I'll be in touch.
Yes this is an issue for us as well. We're using Fyber for rewarded video ads, and for server verification they will hit our callback URL and expect any HTTP response code besides 200 if there was an error processing the callback.
Thanks for the request. I'll run this by the team and see if its suitable as a feature request or there is a workaround that you can use here.
I would also like to have update on this issue. Server to server callbacks are very important for securing ad monetization.
Setting the scriptData with Spark.setScriptData("HTTP_RESPONSE", 403) will set the HTTP_RESPONSE response value in the body of the response. I assume here that SEGA Noah Pass doesn't allow you to read data from the response ? It only allows you to use the response code that the callback returns by default. Is that correct ?
Apologies, but your wording is a little ambiguous to me. However, I believe this is what you're asking:
The SEGA Noah Pass system is not setup to read anything except the HTTP response code. We've also contacted them about a possible workaround, but there is no resolution. Their system expects either an 200 225 or 403 HTTP response code depending on what happens inside the callback, given the information they pass to us. They won't look at the response headers or the response body.
Since gamesparks returns a value of 200 by default, that particular HTTP response code is covered, but the other two are not.
To be very specific, here is the RAW response of our callback (as captured by Postman Canary). I've redacted part of the url:
accept-encoding: gzip, deflate
What we are talking about in this thread specifically are these two lines:HTTP/1.1 200
Any update? Many external services use HTTP status code to detect and handle errors.
Right now setting HTTP_RESPONSE hasn't correct effect.
Ok. Thanks for the details. I'll present this to the dev team give you an update early next week.
Any news on this issue? I need to set the http response code myself, as well.